protected void saveShoudong() { DataAccess.UserCompany userCompany = new DataAccess.UserCompany(); DataAccess.Company company = new DataAccess.Company(); //公司信息 company.CompanyName = ZKRequest.GetString("companyName"); company.CompanyTypeID = short.Parse(ZKEShop.Common.ZKRequest.GetString("companyType")); company.ProvinceID = ZKRequest.GetInt("province",0); company.CityID = ZKRequest.GetInt("city", 0); company.CityZoneID = ZKRequest.GetInt("cityZone", 0); company.Address = ZKRequest.GetString("address"); company.Tellphone = ZKRequest.GetString("companyTel"); company.Website = ZKRequest.GetString("weburl"); company.Describe = ZKRequest.GetString("describe"); //用户与公司的关系 userCompany.iscurrent =ZKRequest.GetString("iscurrent")=="1"?true:false; userCompany.UserID = LoginUser.UserID; userCompany.Company = company; userCompany.logDate = DateTime.Now; userCompany.remark = ZKRequest.GetString("remark");//备注 userCompany.station = ZKRequest.GetString("station");//职位 string joindate = ZKRequest.GetString("joindate");//加入日期 if(!string.IsNullOrEmpty(joindate)) userCompany.joinDate = Convert.ToDateTime(joindate); string leavedate = ZKEShop.Common.ZKRequest.GetString("leavedate");//离开日期 if (!string.IsNullOrEmpty(leavedate)) userCompany.leaveDate = Convert.ToDateTime(leavedate); db.Company.InsertOnSubmit(company); db.SubmitChanges(); Response.Write("<script>alert('保存成功')</script>"); }
public Company CompanyIDataReader(IDataReader dr) { DataAccess.Company obj = new DataAccess.Company(); obj.CompanyID = (dr["CompanyID"] is DBNull) ? string.Empty : dr["CompanyID"].ToString(); obj.CompanyName = (dr["CompanyName"] is DBNull) ? string.Empty : dr["CompanyName"].ToString(); obj.Address = (dr["Address"] is DBNull) ? string.Empty : dr["Address"].ToString(); obj.HotLine = (dr["HotLine"] is DBNull) ? string.Empty : dr["HotLine"].ToString(); obj.PhoneNumber = (dr["PhoneNumber"] is DBNull) ? string.Empty : dr["PhoneNumber"].ToString(); obj.Fax = (dr["Fax"] is DBNull) ? string.Empty : dr["Fax"].ToString(); obj.Email = (dr["Email"] is DBNull) ? string.Empty : dr["Email"].ToString(); obj.Surrogate = (dr["Surrogate"] is DBNull) ? string.Empty : dr["Surrogate"].ToString(); obj.Chevron = (dr["Chevron"] is DBNull) ? string.Empty : dr["Chevron"].ToString(); return(obj); }
public List <Company> Company_GetByLevel(string Level, int LevelLength) { List <DataAccess.Company> list = new List <DataAccess.Company>(); DataAccess.Company obj = new DataAccess.Company(); DbCommand cmd = db.GetStoredProcCommand("sp_Company_GetByLevel", Level, LevelLength); using (IDataReader dr = db.ExecuteReader(cmd)) { while (dr.Read()) { list.Add(obj.CompanyIDataReader(dr)); } dr.Close(); dr.Dispose(); } return(list); }
public List <Company> Company_Paging(string CurentCompany, string CompanySize) { List <DataAccess.Company> list = new List <DataAccess.Company>(); DataAccess.Company obj = new DataAccess.Company(); DbCommand cmd = db.GetStoredProcCommand("Companys_SelectPage", CurentCompany, CompanySize); using (IDataReader dr = db.ExecuteReader(cmd)) { while (dr.Read()) { list.Add(obj.CompanyIDataReader(dr)); } dr.Close(); dr.Dispose(); } return(list); }
public List <Company> Company_GetByAll() { List <DataAccess.Company> list = new List <DataAccess.Company>(); DataAccess.Company obj = new DataAccess.Company(); DbCommand cmd = db.GetStoredProcCommand("Companys_SelectAll"); using (IDataReader dr = db.ExecuteReader(cmd)) { while (dr.Read()) { list.Add(obj.CompanyIDataReader(dr)); } dr.Close(); dr.Dispose(); } return(list); }