• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Ajancy.Kimia_Ajancy类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Ajancy.Kimia_Ajancy的典型用法代码示例。如果您正苦于以下问题:C# Kimia_Ajancy类的具体用法?C# Kimia_Ajancy怎么用?C# Kimia_Ajancy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Kimia_Ajancy类属于Ajancy命名空间,在下文中一共展示了Kimia_Ajancy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int ajancyComplaintId = 0;
         if (int.TryParse(Request.QueryString["id"], out ajancyComplaintId) && Request.QueryString["txt"] != null)
         {
             db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
             Ajancy.AjancyComplaint complaint = db.AjancyComplaints.FirstOrDefault<Ajancy.AjancyComplaint>(jc => jc.AjancyComplaintID == ajancyComplaintId);
             complaint.Reply = Request.QueryString["txt"].Length > 200 ? Request.QueryString["txt"].Substring(0, 200) : Request.QueryString["txt"];
             complaint.ReplyDate = DateTime.Now;
             db.SubmitChanges();
             DisposeContext();
             Response.Clear();
             Response.Write("1");
             Response.End();
         }
         else if (int.TryParse(Request.QueryString["id"], out ajancyComplaintId) && Request.QueryString["txt"] == null)
         {
             db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
             Ajancy.AjancyComplaint complaint = db.AjancyComplaints.FirstOrDefault<Ajancy.AjancyComplaint>(jc => jc.AjancyComplaintID == ajancyComplaintId);
             DisposeContext();
             Response.Clear();
             Response.Write(complaint == null ? null : complaint.Reply);
             Response.End();
         }
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:28,代码来源:HandleComplaints.aspx.cs


示例2: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int personId = 0;
         if (Request.QueryString["id"] != null && int.TryParse(TamperProofString.QueryStringDecode(Request.QueryString["id"]), out personId))
         {
             Ajancy.Kimia_Ajancy db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
             DataLoadOptions dlo = new DataLoadOptions();
             dlo.LoadWith<Ajancy.Person>(p => p.DrivingLicenses);
             dlo.LoadWith<Ajancy.Person>(p => p.DriverCertifications);
             dlo.LoadWith<Ajancy.DriverCertification>(dc => dc.DriverCertificationCars);
             dlo.LoadWith<Ajancy.DriverCertificationCar>(dcc => dcc.CarPlateNumber);
             dlo.LoadWith<Ajancy.CarPlateNumber>(cpn => cpn.PlateNumber);
             dlo.LoadWith<Ajancy.CarPlateNumber>(cpn => cpn.Car);
             dlo.LoadWith<Ajancy.Car>(c => c.FuelCards);
             dlo.LoadWith<Ajancy.Car>(c => c.CarType);
             db.LoadOptions = dlo;
             SetPerson(db.Persons.FirstOrDefault<Ajancy.Person>(p => p.PersonID == personId));
             db.Dispose();
         }
         else
         {
             Response.Redirect("~/Default.aspx");
         }
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:27,代码来源:DriverInfo.aspx.cs


示例3: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int commentId = 0;
         if (Request.QueryString["mode"] != null)
         {
             switch (Request.QueryString["mode"])
             {
                 case "0": // Delete mode
                     if (int.TryParse(Request.QueryString["id"], out commentId))
                     {
                         db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
                         db.Comments.DeleteOnSubmit(db.Comments.First<Ajancy.Comment>(c => c.CommentID == commentId));
                         db.SubmitChanges();
                         DisposeContext();
                         Response.Clear();
                         Response.Write("1");
                         Response.End();
                     }
                     break;
             }
         }
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:25,代码来源:HandleComments.aspx.cs


示例4: fluDocument_UploadedComplete

    protected void fluDocument_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
    {
        if (this.fluDocument.HasFile)
        {
            if (this.fluDocument.PostedFile.ContentType.Equals("image/pjpeg") || this.fluDocument.PostedFile.ContentType.Equals("image/x-png"))
            {
                byte[] fileByte = this.fluDocument.FileBytes;
                Binary binaryObj = new Binary(fileByte);
                Ajancy.Kimia_Ajancy db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
                Ajancy.Doument doc = db.Douments.FirstOrDefault<Ajancy.Doument>(d => d.PersonID == Public.ActiveUserRole.User.PersonID && d.DocumentType == 1);

                if (doc == null)
                {
                    doc = new Ajancy.Doument
                                {
                                    DocumentType = Public.ToByte(this.drpType.SelectedValue),
                                    PersonID = Public.ActiveUserRole.User.PersonID,
                                    Picture = binaryObj,
                                    SubmitDate = DateTime.Now
                                };
                    db.Douments.InsertOnSubmit(doc);
                }
                else
                {
                    doc.Picture = binaryObj;
                }
                db.SubmitChanges();
                db.Dispose();
            }
        }
    }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:31,代码来源:UploadDocument.aspx.cs


示例5: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        int personId = 0;
        if (this.Page.IsValid && int.TryParse(TamperProofString.QueryStringDecode(Request.QueryString["id"]), out personId))
        {
            DataLoadOptions dlo = new DataLoadOptions();
            dlo.LoadWith<Ajancy.Person>(p => p.User);
            db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
            db.LoadOptions = dlo;
            Ajancy.Person person = db.Persons.First<Ajancy.Person>(p => p.PersonID == personId);
            if (person.NationalCode != this.txtNationalCode.Text.Trim()) // Nationalcode is changed
            {
                person.NationalCode = this.txtNationalCode.Text;
                person.User.UserName = this.txtNationalCode.Text;
            }

            person.User.ProvinceID = Public.ToByte(this.drpProvince.SelectedValue);
            person.User.CityID = Public.ToShort(this.drpCity.SelectedValue);
            person.FirstName = this.txtFirstName.Text.Trim();
            person.LastName = this.txtLastName.Text.Trim();
            person.Father = this.txtFather.Text.Trim();
            person.BirthCertificateNo = this.txtBirthCertificateNo.Text.Trim();
            person.BirthCertificateSerial = this.txtBirthCertificateSerial.Text.Trim();
            person.BirthCertificateSerie = this.txtBirthCertificateSerie.Text.Trim();
            person.BirthCertificateAlfa = this.drpBirthCertificateAlfa.SelectedValue;
            person.Gender = Public.ToByte(this.drpGender.SelectedValue);
            person.Marriage = Public.ToByte(this.drpMarriage.SelectedValue);
            person.BirthDate = this.txtBirthDate.GeorgianDate;
            person.BirthPlace = this.txtBirthPlace.Text.Trim();
            person.BirthCertificatePlace = this.txtBirthCertificatePlace.Text.Trim();
            person.FamilyMembersCount = this.txtFamilyMembersCount.Text.Trim();
            person.Education = Public.ToByte(this.drpEducation.SelectedValue);
            person.MilitaryService = Public.ToByte(this.drpMilitaryService.SelectedValue);
            person.Religion = Public.ToByte(this.drpReligion.SelectedValue);
            person.Subreligion = this.txtSubreligion.Text.Trim();
            person.JobStatus = Public.ToByte(this.drpJobStatus.SelectedValue);
            person.Phone = this.txtPhone.Text.Trim();
            person.Mobile = this.txtMobile.Text.Trim();
            person.PostalCode = this.txtPostalCode.Text.Trim();
            person.Address = this.txtAddress.Text.Trim();

            try
            {
                db.SubmitChanges();
                DisposeContext();
                Response.Redirect("~/Message.aspx?mode=17");
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("duplicate key"))
                {
                    this.lblMessage.Text = "کد ملی تکراری میباشد";
                }
            }
        }
    }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:56,代码来源:Person.aspx.cs


示例6: btnChangePassword_Click

 protected void btnChangePassword_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
         db.Users.First<Ajancy.User>(u => u.UserID == Public.ToInt(this.ViewState["UserID"])).PassWord = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtPassword.Text, "SHA1");
         db.SubmitChanges();
         this.btnBack_Click(sender, e);
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:10,代码来源:UsersList.aspx.cs


示例7: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Ajancy.Kimia_Ajancy db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
         this.drpAjancies.DataSource = db.Ajancies.Where(aj => aj.AjancyType == (byte)Public.AjancyType.TaxiAjancy && aj.AjancyName != null).OrderBy(j => j.AjancyName).Select(aj => new { aj.AjancyID, aj.AjancyName });
         this.drpAjancies.DataBind();
         this.drpAjancies.Items.Insert(0, "- همه آژانس ها -");
         this.drpCarType.DataSource = db.CarTypes;
         this.drpCarType.DataBind();
         this.drpCarType.Items.Insert(0, "- همه موارد -");
         db.Dispose();
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:14,代码来源:CertificationlessDrivers.aspx.cs


示例8: btnSearch_Click

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
        var query = from jd in db.AjancyDrivers
                    join c in db.AjancyComplaints on jd.AjancyDriverID equals c.AjancyDriverID
                    join dcc in db.DriverCertificationCars on jd.DriverCertificationCarID equals dcc.DriverCertificationCarID
                    join dc in db.DriverCertifications on dcc.DriverCertificationID equals dc.DriverCertificationID
                    join p in db.Persons on dc.PersonID equals p.PersonID
                    join j in db.Ajancies on jd.AjancyID equals j.AjancyID
                    where j.AjancyID == Public.ActiveAjancy.AjancyID &&
                            (c.RoleID == (byte)(Public.Role.AjancyManager) ||
                             c.RoleID == (byte)(Public.Role.AjancySupervisor))
                    select new
                    {
                        p.FirstName,
                        p.LastName,
                        p.NationalCode,
                        Gender = p.Gender == 0 ? "مرد" : "زن",
                        dc.DriverCertificationNo,
                        c.AjancyComplaintID,
                        c.RoleID,
                        c.SubmitDate,
                        c.Comment,
                        c.ReplyDate,
                        j.AjancyName
                    };

        if (this.drpReplyMode.SelectedIndex == 0)
        {
            query = from q in query
                    where q.ReplyDate != null
                    select q;
        }
        else
        {
            query = from q in query
                    where q.ReplyDate == null
                    select q;
        }

        if (this.txtDateFrom.HasDate && this.txtDateTo.HasDate)
        {
            query = from q in query
                    where q.SubmitDate >= this.txtDateFrom.GeorgianDate && q.SubmitDate <= this.txtDateTo.GeorgianDate
                    select q;
        }

        this.lstComplaints.DataSource = query;
        this.lstComplaints.DataBind();
    }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:50,代码来源:Complaints.aspx.cs


示例9: drpProvince_SelectedIndexChanged

 protected void drpProvince_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.drpProvince.SelectedIndex > 0)
     {
         Ajancy.Kimia_Ajancy db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
         this.drpCity.DataSource = db.Cities.Where<Ajancy.City>(c => c.ProvinceID == Public.ToByte(this.drpProvince.SelectedValue)).Select(c => new { c.CityID, c.Name });
         this.drpCity.DataBind();
     }
     else
     {
         this.drpCity.Items.Clear();
     }
     this.drpCity.Items.Insert(0, "- انتخاب کنید -");
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:14,代码来源:Academies.aspx.cs


示例10: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int fcsId;
            if (int.TryParse(Request.QueryString["fcsId"], out fcsId))
            {
                db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
                db.FuelCardSubstitutions.DeleteOnSubmit(db.FuelCardSubstitutions.First<Ajancy.FuelCardSubstitution>(fcs => fcs.FuelCardSubstituteID == fcsId));
                db.SubmitChanges();
                DisposeContext();
                Response.Clear();
                Response.Write("1");
                Response.End();
            }

            Ajancy.User user = Public.ActiveUserRole.User;
            this.drpProvince.SelectedValue = user.ProvinceID.ToString();
            this.drpProvince_SelectedIndexChanged(sender, e);
            this.drpCity.SelectedValue = user.CityID.ToString();

            switch ((Public.Role)Public.ActiveUserRole.RoleID)
            {
                case Public.Role.Admin:
                    this.drpProvince.Enabled = true;
                    this.drpCity.Enabled = true;
                    this.drpAjancyType.Enabled = true;
                    break;

                case Public.Role.CityManager:
                    this.drpAjancyType.SelectedIndex = 0;
                    break;

                case Public.Role.ProvinceManager:
                    this.drpCity.Enabled = true;
                    this.drpAjancyType.SelectedIndex = 0;
                    break;

                case Public.Role.AcademyCity:
                    this.drpAjancyType.SelectedIndex = 2;
                    break;

                case Public.Role.AcademyProvince:
                    this.drpCity.Enabled = true;
                    this.drpAjancyType.SelectedIndex = 2;
                    break;
            }
        }
    }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:49,代码来源:FCDiscardsRep.aspx.cs


示例11: LoadAjancies

 private void LoadAjancies()
 {
     if (this.drpAjancyType.SelectedIndex > 0)
     {
         this.drpAjancies.Items.Clear();
         db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
         this.drpAjancies.DataSource = db.Ajancies.Where(aj => aj.AjancyType == Public.ToByte(this.drpAjancyType.SelectedValue)).Select(aj => new { aj.AjancyID, aj.AjancyName });
         this.drpAjancies.DataBind();
         this.drpAjancies.Items.Insert(0, new System.Web.UI.WebControls.ListItem("- انتخاب کنید -", "0"));
     }
     else
     {
         this.drpAjancies.Items.Clear();
         this.drpAjancies.Items.Insert(0, new System.Web.UI.WebControls.ListItem("- انتخاب کنید -", "0"));
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:16,代码来源:Comment.aspx.cs


示例12: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int ajancyComplaintId = 0;
         if (int.TryParse(Request.QueryString["id"], out ajancyComplaintId))
         {
             db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
             Ajancy.AjancyComplaint complaint = db.AjancyComplaints.FirstOrDefault<Ajancy.AjancyComplaint>(jc => jc.AjancyComplaintID == ajancyComplaintId);
             DisposeContext();
             Response.Clear();
             Response.Write(complaint == null ? null : complaint.Reply);
             Response.End();
         }
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:16,代码来源:Complaints.aspx.cs


示例13: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.Page.IsValid && this.ViewState["UserID"] != null)
        {
            byte selectedRoleId = byte.Parse(this.drpRoles.SelectedValue);
            ListItem item = null;
            db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
            Ajancy.User user = db.Users.First<Ajancy.User>(u => u.UserID == Public.ToInt(this.ViewState["UserID"]));
            Ajancy.UsersInRole userRole = new Ajancy.UsersInRole { RoleID = selectedRoleId, MembershipDate = DateTime.Now }; ;
            user.UsersInRoles.Add(userRole);

            switch ((Public.Role)selectedRoleId)
            {
                case Public.Role.AjancyManager:
                case Public.Role.AjancySupervisor:
                case Public.Role.AjancySecretary:
                case Public.Role.AjancyPartner:
                    Ajancy.AjancyPartner partner = new Ajancy.AjancyPartner { SubmitDate = DateTime.Now };
                    userRole.AjancyPartners.Add(partner);
                    db.SubmitChanges();
                    item = new ListItem(string.Format("{0} {1}", Public.GetRoleName(userRole.RoleID), "---"), string.Format("{0}|{1}", userRole.UserRoleID, partner.AjancyPartnerID));
                    break;

                case Public.Role.ProvinceManager:
                case Public.Role.AcademyProvince:
                    db.SubmitChanges();
                    item = new ListItem(string.Format("{0} {1}", Public.GetRoleName(selectedRoleId), user.City.Province.Name), string.Format("{0}|0", userRole.UserRoleID));
                    break;

                case Public.Role.CityManager:
                case Public.Role.AcademyCity:
                    db.SubmitChanges();
                    item = new ListItem(string.Format("{0} {1}", Public.GetRoleName(selectedRoleId), user.City.Name), string.Format("{0}|0", userRole.UserRoleID));
                    break;

                default:
                    db.SubmitChanges();
                    item = new ListItem(Public.GetRoleName(selectedRoleId), string.Format("{0}|0", userRole.UserRoleID));
                    break;
            }

            item.Selected = true;
            this.lstRoles.Items.Add(item);
            this.drpRoles.Items.Remove(this.drpRoles.SelectedItem);
            this.lblMessage.Text = "ثبت سمت انجام گردید";
        }
    }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:47,代码来源:UserRoles.aspx.cs


示例14: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.Page.IsValid)
        {
            int carId = Public.ToInt(this.drpCars.SelectedValue);
            db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
            db.FuelCards.First<Ajancy.FuelCard>(fc => fc.CarID == carId && fc.DiscardDate == null).DiscardDate = DateTime.Now;
            db.FuelCards.InsertOnSubmit(new Ajancy.FuelCard
            {
                CarID = carId
                                 ,
                CardType = Public.ToByte(this.drpFuelCardType.SelectedValue)
                                 ,
                PAN = this.txtFuelCardPAN.Text.Trim()
                                 ,
                SubmitDate = DateTime.Now
            });

            try
            {
                db.SubmitChanges();
                DisposeContext();
                this.drpCars_SelectedIndexChanged(sender, e);
                this.lblMessage.Text = Public.SAVEMESSAGE;
                this.drpFuelCardType.SelectedIndex = 0;
                this.txtFuelCardPAN.Text = null;
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("UNIQUE KEY"))
                {
                    this.lblMessage.Text = "شماره PAN کارت سوخت قبلا برای خودرو دیگری ثبت شده";
                }
                else
                {
                    throw ex;
                }
            }
        }
    }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:40,代码来源:AddFuelCard.aspx.cs


示例15: lstRoles_SelectedIndexChanged

 protected void lstRoles_SelectedIndexChanged(object sender, EventArgs e)
 {
     db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
     foreach (ListItem item in this.lstRoles.Items)
     {
         string[] roleParts = item.Value.Split('|');
         if (roleParts[1] == "0")
         {
             Ajancy.UsersInRole userRole = db.UsersInRoles.First<Ajancy.UsersInRole>(ur => ur.UserRoleID == Public.ToInt(roleParts[0]));
             if (item.Selected && userRole.LockOutDate.HasValue) // unlock this role
             {
                 userRole.LockOutDate = null;
                 db.SubmitChanges();
                 break;
             }
             else if (!item.Selected && !userRole.LockOutDate.HasValue) // lock this role
             {
                 userRole.LockOutDate = DateTime.Now;
                 db.SubmitChanges();
                 break;
             }
         }
         else if (roleParts.Length == 2) // Ajancy partners
         {
             Ajancy.AjancyPartner partner = db.AjancyPartners.First<Ajancy.AjancyPartner>(jp => jp.AjancyPartnerID == Public.ToInt(roleParts[1]));
             if (item.Selected && partner.LockOutDate.HasValue) // unlock this role
             {
                 partner.LockOutDate = null;
                 db.SubmitChanges();
                 break;
             }
             else if (!item.Selected && !partner.LockOutDate.HasValue) // lock this role
             {
                 partner.LockOutDate = DateTime.Now;
                 db.SubmitChanges();
                 break;
             }
         }
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:40,代码来源:UserRoles.aspx.cs


示例16: btnSave_Click

 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         Ajancy.Kimia_Ajancy db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
         Ajancy.User user = db.Users.FirstOrDefault<Ajancy.User>(u => u.UserName == HttpContext.Current.User.Identity.Name && u.PassWord == FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtOldPassword.Text, "SHA1"));
         if (user != null)
         {
             user.PassWord = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtNewPassword.Text, "SHA1");
             db.SubmitChanges();
             db.Dispose();
             this.lblMessage.Text = "ویرایش گذرواژه انجام گردید";
         }
         else
         {
             this.lblMessage.Text = "گذرواژه نادرست میباشد";
         }
     }
     this.txtOldPassword.Text = null;
     this.txtNewPassword.Text = null;
     this.txtRePassword.Text = null;
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:22,代码来源:EditPassword.aspx.cs


示例17: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid && this.ViewState["AjancyDriverID"] != null)
        {
            string[] vals = this.ViewState["AjancyDriverID"].ToString().Split('|');
            if (vals[1] == this.drpAjancies.SelectedValue) // No new ajancy is selected
            {
                return;
            }

            db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
            Ajancy.AjancyDriver ajancyDriver = db.AjancyDrivers.First<Ajancy.AjancyDriver>(jd => jd.AjancyDriverID == Public.ToInt(vals[0]));
            ajancyDriver.LockOutDate = DateTime.Now;
            db.AjancyDrivers.InsertOnSubmit(new Ajancy.AjancyDriver { AjancyID = Public.ToInt(this.drpAjancies.SelectedValue), DriverCertificationCarID = ajancyDriver.DriverCertificationCarID, MembershipDate = DateTime.Now });
            db.SubmitChanges();
            this.lblMessage.Text = Public.SAVEMESSAGE;
            this.ViewState["AjancyDriverID"] = null;
            this.txtNationalCode.Text = null;
            this.drpAjancies.Items.Clear();
            this.drpAjancies.Enabled = false;
            this.btnSave.Enabled = false;
        }
    }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:23,代码来源:TransferDriver.aspx.cs


示例18: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            Ajancy.Comment comment = new Ajancy.Comment();
            comment.DriverFirstName = this.txtDriverFirstName.Text;
            comment.DriverLastName = this.txtDriverLastName.Text;
            comment.FirstName = this.txtFirstName.Text;
            comment.LastName = this.txtLastName.Text;
            comment.Phone = this.txtPhone.Text;
            comment.Email = this.txtEmail.Text;
            comment.AjancyID = Public.ToInt(this.drpAjancies.SelectedValue);
            comment.Subject = Public.ToByte(this.drpSubject.SelectedValue);
            comment.ProblemDate = new DateTime(this.txtProblemDate.GeorgianDate.Value.Year, this.txtProblemDate.GeorgianDate.Value.Month, this.txtProblemDate.GeorgianDate.Value.Day, this.txtTime.Time.Hours, this.txtTime.Time.Minutes, 0);
            comment.CommentText = this.txtComment.Text;
            comment.SubmitDate = DateTime.Now;
            db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);

            if (!string.IsNullOrEmpty(this.txtCarPlateNumber_1.Text) && !string.IsNullOrEmpty(this.txtCarPlateNumber_2.Text) && !string.IsNullOrEmpty(this.txtCarPlateNumber_3.Text))
            {
                Ajancy.PlateNumber plateNumber = db.PlateNumbers.FirstOrDefault<Ajancy.PlateNumber>(pn => pn.TwoDigits == this.txtCarPlateNumber_1.Text &&
                                                                                                                                                 pn.Alphabet == this.drpCarPlateNumber.SelectedValue &&
                                                                                                                                                 pn.ThreeDigits == this.txtCarPlateNumber_3.Text &&
                                                                                                                                                 pn.RegionIdentifier == this.txtCarPlateNumber_3.Text);
                if (plateNumber == null)
                {
                    this.lblMessage.Text = "کابر گرامی شماره پلاک مورد نظر شما متعلق به رانندگان این اتحادیه نمیباشد در صورت اطمینان از درست بودن شماره پلاک در قسمت توضیحات آنرا بنویسید";
                    return;
                }
                comment.PlateNumberID = plateNumber.PlateNumberID;
            }

            db.Comments.InsertOnSubmit(comment);
            db.SubmitChanges();
            Response.Redirect("~/Default.aspx");
        }
    }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:37,代码来源:Comment.aspx.cs


示例19: FillGrid

    private void FillGrid()
    {
        db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
        var query = from c in db.Comments
                    join j in db.Ajancies on c.AjancyID equals j.AjancyID
                    select new
                    {
                        j.AjancyName,
                        c.CommentID,
                        c.Subject,
                        c.DriverFirstName,
                        c.DriverLastName,
                        c.FirstName,
                        c.LastName,
                        c.Phone,
                        c.PlateNumber,
                        c.ProblemDate,
                        c.Email,
                        c.CommentText,
                        c.SubmitDate
                    };
        if (this.txtDateFrom.HasDate)
        {
            query = from q in query
                    where q.SubmitDate >= this.txtDateFrom.GeorgianDate
                    select q;
        }
        if (this.txtDateFrom.HasDate && this.txtDateTo.HasDate)
        {
            query = from q in query
                    where q.SubmitDate <= this.txtDateTo.GeorgianDate
                    select q;
        }

        this.lstComplaints.DataSource = query;
        this.lstComplaints.DataBind();
    }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:37,代码来源:HandleComments.aspx.cs


示例20: drpCars_SelectedIndexChanged

 protected void drpCars_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.drpCars.SelectedIndex > 0)
     {
         db = new Ajancy.Kimia_Ajancy(Public.ConnectionString);
         var fcList = db.FuelCards.Where(fc => fc.CarID == Public.ToInt(this.drpCars.SelectedValue)).Select(fc => new { fc.CardType, fc.PAN, fc.DiscardDate });
         string _html = "<table id='list'>";
         _html += "<tr>";
         _html += "<th style='width: 20px;'></th>";
         _html += "<th>PAN</th>";
         _html += "<th>نوع کارت سوخت</th>";
         _html += "<th></th>";
         _html += "</tr>";
         string color = "#ffffff";
         byte counter = 1;
         foreach (var item in fcList)
         {
             _html += string.Format("<tr style='background-color: {0};'><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td></tr>", color, counter, item.PAN, Public.GetFuelCardTypeName((Public.FuelCardType)item.CardType), item.DiscardDate == null ? "فعال" : "غیرفعال");
             if (counter % 2 == 1) // change color for alternative row
             {
                 color = "#f8faff";
             }
             else
             {
                 color = "#ffffff";
             }
             counter++;
         }
         _html += "</table>";
         this.dvFCcontainer.InnerHtml = _html;
     }
     else
     {
         this.dvFCcontainer.InnerHtml = null;
     }
 }
开发者ID:BehnamAbdy,项目名称:Ajancy,代码行数:36,代码来源:AddFuelCard.aspx.cs



注:本文中的Ajancy.Kimia_Ajancy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Sanitizer.DefaultHtmlSanitizer类代码示例发布时间:2022-05-24
下一篇:
C# Visitors.AstComparisonVisitor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap