本文整理汇总了C#中Ajancy.Kimia_Ajancy类的典型用法代码示例。如果您正苦于以下问题:C# Kimia_Ajancy类的具体用法?C# Kimia_Ajancy怎么用?C# Kimia_Ajancy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Kimia_Ajancy类属于Ajancy命名空间,在下文中一共展示了Kimia_Ajancy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
}
示例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");
}
}
}
示例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;
}
}
}
}
示例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();
}
}
}
示例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 = "کد ملی تکراری میباشد";
}
}
}
}
示例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);
}
}
示例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();
}
}
示例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();
}
示例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, "- انتخاب کنید -");
}
示例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;
}
}
}
示例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"));
}
}
示例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();
}
}
}
示例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 = "ثبت سمت انجام گردید";
}
}
示例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;
}
}
}
}
示例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;
}
}
}
}