protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Session["EditIsEnterpriseSubmit"] != null)
            {
                return;
            }
            zlzw.BLL.CoreUserBLL coreUserBLL = new zlzw.BLL.CoreUserBLL();
            DataTable dt = coreUserBLL.GetList("UserGuid='" + Request.QueryString["ID"] + "'").Tables[0];
            zlzw.Model.CoreUserModel coreUserModel = coreUserBLL.GetModel(int.Parse(dt.Rows[0]["UserID"].ToString()));
            zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL();
            DataTable dt01 = generalEnterpriseBLL.GetList("UserGuid='" + Request.QueryString["ID"] + "'").Tables[0];
            zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = generalEnterpriseBLL.GetModel(int.Parse(dt01.Rows[0]["EnterpriseID"].ToString()));
            coreUserModel.UserName = Request.Form["txbUserName"];//账号
            coreUserModel.Password = Request.Form["txbPassword"];//密码
            coreUserModel.UserMobileNO = Request.Form["txbUserMobileNO"];//手机号
            coreUserModel.UserRegisterDate = DateTime.Parse(ViewState["UserRegisterDate"].ToString());//用户注册日期
            coreUserModel.UserLastDateTime = DateTime.Parse(ViewState["UserLastDateTime"].ToString());//用户最后一次登录日期
            coreUserModel.UserType = 2;//企业用户
            coreUserModel.UserStatus = 1;//状态可用
            coreUserModel.UserID = int.Parse(dt.Rows[0]["UserID"].ToString());//CoerUser表ID

            generalEnterpriseModel.EnterpriseID = int.Parse(dt01.Rows[0]["EnterpriseID"].ToString());//企业表ID
            generalEnterpriseModel.CompanyName = txbEnterpriseName.Text;//企业名称
            //generalEnterpriseModel.IndustryKey = Request.Form["drpJobFeildKindsType"] + "-" + Request.Form["drpItems"];//公司行业
            generalEnterpriseModel.IndustryKey = Get_CurrentValue(Request.Params["txbJobFeildKinds"]) + "-" + Request.Params["txbJobFeildKinds"];
            generalEnterpriseModel.PrincipleAddress = Request.Form["txbPrincipleAddress"];//公司地址
            generalEnterpriseModel.Telephone = Request.Form["txbTelephone"];//联系电话
            generalEnterpriseModel.ContactPerson = Request.Form["txbContactPerson"];//联系人
            generalEnterpriseModel.Email = Request.Form["txbEmail"];//电子邮件
            generalEnterpriseModel.EnterpriseWWW = Request.Form["txbEnterpriseWWW"];//公司网站
            generalEnterpriseModel.BusRoute = Request.Form["txbBusRoute"];//乘车路线
            generalEnterpriseModel.CanUsable = 1;
            generalEnterpriseModel.LastUpdateDate = DateTime.Now;//最后一次修改日期
            generalEnterpriseModel.CreateDate = DateTime.Parse(ViewState["CreateDate"].ToString());//创建日期
            generalEnterpriseModel.ShengName = Request.Form["drpShengList"];//省名称
            generalEnterpriseModel.ShiName = Request.Form["drpShiList"];//市名称
            generalEnterpriseModel.QuName = Request.Form["drpQuList"];//区名称
            generalEnterpriseModel.EnterpriseDescription = Request.Form["txbEnterpriseDescription"];//企业简介

            if (uploadBusinessLicense.HasFile)
            {
                string strFileExt = System.IO.Path.GetExtension(uploadBusinessLicense.FileName);
                if (strFileExt == ".jpg" || strFileExt == ".gif" || strFileExt == ".png" || strFileExt == ".jpeg" || strFileExt == ".bmp")
                {
                    string strFilePath = "~/BusinessLicense/" + txbEnterpriseName.Text + "_" + DateTime.Now.ToString("yyyyMMddhhmmss") + "_" + strFileExt;
                    uploadBusinessLicense.SaveAs(Server.MapPath(strFilePath));
                    generalEnterpriseModel.BusinessLicense = strFilePath;
                }
            }
            try
            {
                coreUserBLL.Update(coreUserModel);
                generalEnterpriseBLL.Update(generalEnterpriseModel);
                if (Session["EditIsEnterpriseSubmit"] == null)
                {
                    FineUI.Alert.Show("修改信息注册成功");
                    Session["EditIsEnterpriseSubmit"] = "1";
                }
                System.Web.HttpCookie UserGUID = System.Web.HttpContext.Current.Request.Cookies["CurrentUserGUID"];
                System.Web.HttpCookie UserName = System.Web.HttpContext.Current.Request.Cookies["CurrentUserName"];

                UserGUID.Expires = DateTime.Now.AddDays(-1);
                UserName.Expires = DateTime.Now.AddDays(-1);

                System.Web.HttpContext.Current.Response.Cookies.Add(UserGUID);
                System.Web.HttpContext.Current.Response.Cookies.Add(UserName);
                Response.Redirect("default.aspx");
            }
            catch (Exception exp)
            {
                FineUI.Alert.Show("修改信息失败,请稍后重试");
            }
        }
        private void Load_EnterpriseInfo(string strUserGUID)
        {
            zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL();
            DataTable dt01 = generalEnterpriseBLL.GetList("EnterpriseGuid='" + strUserGUID + "'").Tables[0];
            zlzw.BLL.CoreUserBLL coreUserBLL = new zlzw.BLL.CoreUserBLL();
            DataTable dt = coreUserBLL.GetList("UserGuid='" + dt01.Rows[0]["UserGuid"].ToString() + "'").Tables[0];
            zlzw.Model.CoreUserModel coreUserModel = coreUserBLL.GetModel(int.Parse(dt.Rows[0]["UserID"].ToString()));
            
            zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = generalEnterpriseBLL.GetModel(int.Parse(dt01.Rows[0]["EnterpriseID"].ToString()));
            txbUserName.Text = coreUserModel.UserName;//账号
            txbEnterpriseName.Text = generalEnterpriseModel.CompanyName;//公司名称
            //drpJobFeildKindsType.SelectedValue = generalEnterpriseModel.IndustryKey.Split('-')[0];//所属行业
            //LoadItemList(generalEnterpriseModel.IndustryKey.Split('-')[0]);
            //drpItems.SelectedValue = generalEnterpriseModel.IndustryKey.Split('-')[1];//所属行业分类
            txbJobFeildKinds.Value = generalEnterpriseModel.IndustryKey;//所属行业分类
            drpShengList.SelectedValue = generalEnterpriseModel.ShengName;
            Load_ShiList(generalEnterpriseModel.ShengName);
            drpShiList.SelectedValue = generalEnterpriseModel.ShiName;
            Load_QuList(generalEnterpriseModel.ShiName);
            drpQuList.SelectedValue = generalEnterpriseModel.QuName;

            txbPrincipleAddress.Text = generalEnterpriseModel.PrincipleAddress;//公司地址
            txbTelephone.Text = generalEnterpriseModel.Telephone;//联系电话
            txbContactPerson.Text = generalEnterpriseModel.ContactPerson;//联系人
            txbUserMobileNO.Text = coreUserModel.UserMobileNO;//手机号码
            txbEmail.Text = generalEnterpriseModel.Email;//邮箱地址
            txbEnterpriseWWW.Text = generalEnterpriseModel.EnterpriseWWW;//企业网址
            txbBusRoute.Text = generalEnterpriseModel.BusRoute;//乘车路线
            drpShengList.SelectedValue = generalEnterpriseModel.ShengName;//省名称
            drpShiList.SelectedValue = generalEnterpriseModel.ShiName;//市名称
            drpQuList.SelectedValue = generalEnterpriseModel.QuName;//区名称
            txbEnterpriseDescription.Text = generalEnterpriseModel.EnterpriseDescription;//企业简介
            ViewState["CreateDate"] = generalEnterpriseModel.CreateDate.ToString();//创建日期
            ViewState["uploadBusinessLicense"] = generalEnterpriseModel.BusinessLicense;//营业执照
            ViewState["UserRegisterDate"] = DateTime.Parse(coreUserModel.UserRegisterDate.ToString());//CoreUser注册时间
            ViewState["UserLastDateTime"] = DateTime.Parse(coreUserModel.UserRegisterDate.ToString());//CoreUser最后一次登陆时间
        }
        protected void imgBtnDownload_Click(object sender, ImageClickEventArgs e)
        {
            string strEnterpriseGUID = Get_EnterpriaseGUID(Request.Cookies["CurrentUserGUID"].Value);
            zlzw.Model.ResumeCollectionListModel resumeCollectionListModel = new zlzw.Model.ResumeCollectionListModel();
            resumeCollectionListModel.ResumeCollectionType = 0;//类型为企业简历收藏
            resumeCollectionListModel.ResumeGuid = new Guid(Request.QueryString["id"]);//当前简历GUID
            resumeCollectionListModel.EnterpriseGuid = new Guid(strEnterpriseGUID);//收藏企业的GUID
            resumeCollectionListModel.EnterpriseIsDel = 1;//企业标注为可显示
            resumeCollectionListModel.IsEnable = 1;
            resumeCollectionListModel.PublishDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));

            #region 减去可下载简历数

            zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL();
            System.Data.DataTable dt = generalEnterpriseBLL.GetList("EnterpriseGuid='" + strEnterpriseGUID + "'").Tables[0];
            zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = generalEnterpriseBLL.GetModel(int.Parse(dt.Rows[0]["EnterpriseID"].ToString()));
            if (generalEnterpriseModel.DownloadResume < 1)
            {
                FineUI.Alert.Show("您剩余的简历下载数不足,请联系我们的客服人员");
                return;
            }
            generalEnterpriseModel.DownloadResume = generalEnterpriseModel.DownloadResume - 1;
            generalEnterpriseModel.CreateDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
            zlzw.BLL.ResumeCollectionListBLL resumeCollectionListBLL = new zlzw.BLL.ResumeCollectionListBLL();
            resumeCollectionListBLL.Add(resumeCollectionListModel);
            generalEnterpriseBLL.Update(generalEnterpriseModel);

            FineUI.Alert.Show("简历下载成功");

            #endregion

        }
        protected void btnDel_Click(object sender, EventArgs e)
        {
            if (grid1.SelectedRowIndexArray != null && grid1.SelectedRowIndexArray.Length > 0)
            {
                string strSelectID = "0";
                for (int i = 0, count = grid1.SelectedRowIndexArray.Length; i < count; i++)
                {
                    int rowIndex = grid1.SelectedRowIndexArray[i];
                    foreach (object key in grid1.DataKeys[rowIndex])
                    {
                        strSelectID = key.ToString();
                    }
                }

                #region 删除逻辑

                zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL();
                DataTable dt = generalEnterpriseBLL.GetList("EnterpriseGuid='" + strSelectID + "'").Tables[0];
                zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = generalEnterpriseBLL.GetModel(int.Parse(dt.Rows[0]["EnterpriseID"].ToString()));
                generalEnterpriseModel.CanUsable = 0;
                generalEnterpriseBLL.Update(generalEnterpriseModel);
                GeneralEnterpriseList_BindGrid();

                #endregion
            }
            else
            {
                return;
            }
        }
 private void LoadData(string strType)
 {
     if (strType == "1")
     {
         string strID = Request.QueryString["value"];//操作ID
         zlzw.BLL.GeneralEnterpriseBLL generalEnterpriseBLL = new zlzw.BLL.GeneralEnterpriseBLL();
         zlzw.Model.GeneralEnterpriseModel generalEnterpriseModel = generalEnterpriseBLL.GetModel(int.Parse(Get_ID(generalEnterpriseBLL, strID)));
         txbCompanyName.Text = generalEnterpriseModel.CompanyName;//企业名称
         drpIndustryKey.SelectedValue = generalEnterpriseModel.IndustryKey;//所属行业
         ddlSheng.SelectedValue = generalEnterpriseModel.ShengCode;//企业所在省代码
         BindShi("1");
         ddlShi.SelectedValue = generalEnterpriseModel.ShiCode;//企业所在市代码
         BindXian("1");
         ddlXian.SelectedValue = generalEnterpriseModel.QuCode;//企业所在区代码
         txbPrincipleAddress.Text = generalEnterpriseModel.PrincipleAddress;//企业所在地址
         txbTelephone.Text = generalEnterpriseModel.Telephone;//联系电话
         txbTelephoneOther.Text = generalEnterpriseModel.TelephoneOther;//其他联系电话
         txbFax.Text = generalEnterpriseModel.Fax;//传真
         txbEmail.Text = generalEnterpriseModel.Email;//电子邮件
         txbContactPerson.Text = generalEnterpriseModel.ContactPerson;//联系人
         txbEnterpriseWWW.Text = generalEnterpriseModel.EnterpriseWWW;//企业网址
         txbBusRoute.Text = generalEnterpriseModel.BusRoute;//乘车路线
         if (generalEnterpriseModel.IsEmergencyRecruitment.ToString() == "0")
         {
             ckbIsEmergencyRecruitment.Checked = false;
         }
         else
         {
             ckbIsEmergencyRecruitment.Checked = true;
         }
         //是否允许职位发布
         if (generalEnterpriseModel.IsEnablePublishJob.ToString() == "1")
         {
             ckbIsEnablePublishJob.Checked = true;
         }
         else
         {
             ckbIsEnablePublishJob.Checked = false;
         }
         txbDownloadResume.Text = generalEnterpriseModel.DownloadResume.ToString();//允许陌生简历下载次数
         txbEnterpriseDescription.Text = generalEnterpriseModel.EnterpriseDescription;//企业简介
         ViewState["fileBusinessLicense"] = generalEnterpriseModel.BusinessLicense;//营业执照存储地址
         ViewState["CreateDate"] = generalEnterpriseModel.CreateDate.ToString();
         ViewState["EnterpriseGuid"] = generalEnterpriseModel.EnterpriseGuid.ToString();
         ViewState["UserGuid"] = generalEnterpriseModel.UserGuid.ToString();
         ToolbarText2.Text = "编辑一个管理员账号";
     }
     btnClose.OnClientClick = ActiveWindow.GetConfirmHideReference();
 }