Ejemplo n.º 1
0
 //修改
 public int EnterpriseUpdate(Tz888.Model.Register.EnterpriseInfoModel model,
                             Tz888.Model.Register.OrgContactModel ContactModel,
                             List <Tz888.Model.Register.OrgContactMan> ContactManModels,
                             List <Tz888.Model.MemberResourceModel> infoResourceModels)
 {
     return(dal.EnterpriseUpdate(model, ContactModel, ContactManModels, infoResourceModels));
 }
Ejemplo n.º 2
0
        //审核
        public bool AuditEnterprise(Tz888.Model.Register.EnterpriseInfoModel Enterprise, Tz888.Model.Register.OrgAuditModel OrgAudi)
        {
            SqlParameter[] parameters =
            {
                #region  公司基本信息
                new SqlParameter("@EnterpriseID",     SqlDbType.Int,         4),
                new SqlParameter("@LoginName",        SqlDbType.Char,       16),
                new SqlParameter("@EnterpriseName",   SqlDbType.VarChar,   200),
                new SqlParameter("@ComAbout",         SqlDbType.VarChar,    -1),
                new SqlParameter("@ComAboutBrief",    SqlDbType.VarChar,    -1),
                new SqlParameter("@ManageTypeID",     SqlDbType.Char,       10),
                new SqlParameter("@Industrylist",     SqlDbType.Char,       10),
                new SqlParameter("@RegisterDate",     SqlDbType.DateTime),
                new SqlParameter("@CountryCode",      SqlDbType.Char,       10),
                new SqlParameter("@ProvinceID",       SqlDbType.Char,       10),
                new SqlParameter("@CityID",           SqlDbType.Char,       10),
                new SqlParameter("@CountyID",         SqlDbType.Char,       10),
                new SqlParameter("@currency",         SqlDbType.Char,       10),
                new SqlParameter("@RegCapital",       SqlDbType.Float,       8),
                new SqlParameter("@MainProduct",      SqlDbType.VarChar,    30),
                new SqlParameter("@RequirInfo",       SqlDbType.Char,       30),
                new SqlParameter("@AuditingStatus",   SqlDbType.TinyInt,     1), //审核结果(1审核通过,2审核不通过)
                new SqlParameter("@ExhibitionHall",   SqlDbType.VarChar,   100), //展厅
                new SqlParameter("@hits",             SqlDbType.VarChar,   100), //点数
                new SqlParameter("@remark",           SqlDbType.VarChar,   100), //备注
                #endregion
                #region 附加信息

                #endregion
                #region 联系方式
                new SqlParameter("@LoginName",        SqlDbType.Char,       16),
                new SqlParameter("@OrganizationName", SqlDbType.VarChar,   100),
                new SqlParameter("@Name",             SqlDbType.VarChar,    20),
                new SqlParameter("@Career",           SqlDbType.VarChar,    20),
                new SqlParameter("@TelCountryCode",   SqlDbType.Char,        3),
                new SqlParameter("@TelStateCode",     SqlDbType.Char,        4),
                new SqlParameter("@TelNum",           SqlDbType.VarChar,    60),
                new SqlParameter("@FaxCountryCode",   SqlDbType.Char,        3),
                new SqlParameter("@FaxStateCode",     SqlDbType.Char,        4),
                new SqlParameter("@FaxNum",           SqlDbType.VarChar,    60),
                new SqlParameter("@Email",            SqlDbType.VarChar,    50),
                new SqlParameter("@Mobile",           SqlDbType.VarChar,    30),
                new SqlParameter("@address",          SqlDbType.VarChar,   100),
                new SqlParameter("@PostCode",         SqlDbType.VarChar,    10),
                new SqlParameter("@IsDel",            SqlDbType.Bit,         1),
                new SqlParameter("@remark",           SqlDbType.VarChar,   100),
                #endregion
                #region  审核记录
                //new SqlParameter("@OrgName", SqlDbType.VarChar,200),= @EnterpriseName
                //new SqlParameter("@LoginName", SqlDbType.Char,16),
                new SqlParameter("@AuditingRemark",   SqlDbType.VarChar,   100), //未通过审核原因
                new SqlParameter("@AuditingBy",       SqlDbType.VarChar,    20), //审核人
                new SqlParameter("@AuditingDate",     SqlDbType.DateTime),       //审核时间
                new SqlParameter("@FeedbackStatus",   SqlDbType.TinyInt,     1), //反馈状态
                new SqlParameter("@FeedBackNote",     SqlDbType.VarChar,   300), //邮件反馈内容
                new SqlParameter("@OrgType",          SqlDbType.TinyInt,     1), //组织类型(0企业,1政府机构)
                new SqlParameter("@Memo",             SqlDbType.VarChar, 200)    //备注
                #endregion
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = Enterprise.LoginName;
            parameters[2].Value     = Enterprise.EnterpriseName;
            parameters[3].Value     = Enterprise.ComAbout;
            parameters[4].Value     = Enterprise.ComAboutBrief;
            parameters[5].Value     = Enterprise.SetComTypeID;
            parameters[6].Value     = Enterprise.Industrylist;
            parameters[7].Value     = Enterprise.RegisterDate;
            parameters[8].Value     = Enterprise.CountryCode;
            parameters[9].Value     = Enterprise.ProvinceID;
            parameters[10].Value    = Enterprise.CityID;
            parameters[11].Value    = Enterprise.CountyID;
            parameters[12].Value    = Enterprise.currency;
            parameters[13].Value    = Enterprise.RegCapital;
            parameters[14].Value    = Enterprise.MainProduct;
            parameters[15].Value    = Enterprise.RequirInfo;
            parameters[16].Value    = Enterprise.AuditingStatus;
            parameters[17].Value    = Enterprise.ExhibitionHall;
            parameters[18].Value    = Enterprise.hits;
            parameters[19].Value    = Enterprise.remark;

            parameters[20].Value = OrgAudi.AuditingRemark;
            parameters[21].Value = OrgAudi.AuditingBy;
            parameters[22].Value = OrgAudi.AuditingDate;
            parameters[23].Value = OrgAudi.FeedbackStatus;
            parameters[24].Value = OrgAudi.FeedBackNote;
            parameters[25].Value = OrgAudi.OrgType;
            parameters[26].Value = OrgAudi.Memo;
            return(true);
        }
Ejemplo n.º 3
0
        //修改
        public int EnterpriseUpdate(Tz888.Model.Register.EnterpriseInfoModel model,
                                    Tz888.Model.Register.OrgContactModel ContactModel,
                                    List <Tz888.Model.Register.OrgContactMan> ContactManModels,
                                    List <Tz888.Model.MemberResourceModel> infoResourceModels)
        {
            SqlParameter[] parameters =
            {
                #region  公司基本信息
                new SqlParameter("@EnterpriseID",     SqlDbType.Int,         4),
                new SqlParameter("@LoginName",        SqlDbType.Char,       16),
                new SqlParameter("@EnterpriseName",   SqlDbType.VarChar,   200),
                new SqlParameter("@ComAbout",         SqlDbType.VarChar,    -1),
                new SqlParameter("@ComAboutBrief",    SqlDbType.VarChar,    -1),
                new SqlParameter("@SetComTypeID",     SqlDbType.Char,       10),
                new SqlParameter("@Industrylist",     SqlDbType.Char,       10),
                new SqlParameter("@RegisterDate",     SqlDbType.DateTime),
                new SqlParameter("@CountryCode",      SqlDbType.Char,       10),
                new SqlParameter("@ProvinceID",       SqlDbType.Char,       10),
                new SqlParameter("@CityID",           SqlDbType.Char,       10),
                new SqlParameter("@CountyID",         SqlDbType.Char,       10),
                new SqlParameter("@currency",         SqlDbType.Char,       10),
                new SqlParameter("@RegCapital",       SqlDbType.Float,       8),
                new SqlParameter("@MainProduct",      SqlDbType.VarChar,    30),
                new SqlParameter("@RequirInfo",       SqlDbType.Char,       30),
                new SqlParameter("@AuditingStatus",   SqlDbType.TinyInt,     1),
                new SqlParameter("@ExhibitionHall",   SqlDbType.VarChar,   100),
                new SqlParameter("@hits",             SqlDbType.VarChar,   100),
                new SqlParameter("@remark",           SqlDbType.VarChar,   100),
                #endregion

                #region 联系方式

                new SqlParameter("@OrganizationName", SqlDbType.VarChar,   100),
                new SqlParameter("@Name",             SqlDbType.VarChar,    20),
                new SqlParameter("@Career",           SqlDbType.VarChar,    20),
                new SqlParameter("@TelCountryCode",   SqlDbType.Char,        6),
                new SqlParameter("@TelStateCode",     SqlDbType.Char,        8),
                new SqlParameter("@TelNum",           SqlDbType.VarChar,   100),
                new SqlParameter("@FaxCountryCode",   SqlDbType.Char,        6),
                new SqlParameter("@FaxStateCode",     SqlDbType.Char,        8),
                new SqlParameter("@FaxNum",           SqlDbType.VarChar,   100),
                new SqlParameter("@Email",            SqlDbType.VarChar,    50),
                new SqlParameter("@Mobile",           SqlDbType.VarChar,    30),
                new SqlParameter("@address",          SqlDbType.VarChar,   100),
                new SqlParameter("@PostCode",         SqlDbType.VarChar,    10),
                new SqlParameter("@Website",          SqlDbType.VarChar,   200),
                new SqlParameter("@IsDel",            SqlDbType.Bit,         1),
                new SqlParameter("@remark1",          SqlDbType.VarChar, 100)
                #endregion
            };
            parameters[0].Value  = model.EnterpriseID;
            parameters[1].Value  = model.LoginName;
            parameters[2].Value  = model.EnterpriseName;
            parameters[3].Value  = model.ComAbout;
            parameters[4].Value  = model.ComAboutBrief;
            parameters[5].Value  = model.SetComTypeID;
            parameters[6].Value  = model.Industrylist;
            parameters[7].Value  = model.RegisterDate;
            parameters[8].Value  = model.CountryCode;
            parameters[9].Value  = model.ProvinceID;
            parameters[10].Value = model.CityID;
            parameters[11].Value = model.CountyID;
            parameters[12].Value = model.currency;
            parameters[13].Value = model.RegCapital;
            parameters[14].Value = model.MainProduct;
            parameters[15].Value = model.RequirInfo;
            parameters[16].Value = model.AuditingStatus;
            parameters[17].Value = model.ExhibitionHall;
            parameters[18].Value = model.hits;
            parameters[19].Value = model.remark;

            parameters[20].Value = model.EnterpriseName;; //ContactModel.Name;
            parameters[21].Value = ContactModel.Name;
            parameters[22].Value = ContactModel.Career;
            parameters[23].Value = ContactModel.TelCountryCode;
            parameters[24].Value = ContactModel.TelStateCode;
            parameters[25].Value = ContactModel.TelNum;
            parameters[26].Value = ContactModel.FaxCountryCode;
            parameters[27].Value = ContactModel.FaxStateCode;
            parameters[28].Value = ContactModel.FaxNum;
            parameters[29].Value = ContactModel.Email;
            parameters[30].Value = ContactModel.Mobile;
            parameters[31].Value = ContactModel.address;
            parameters[32].Value = ContactModel.PostCode;
            parameters[33].Value = ContactModel.Website;
            parameters[34].Value = ContactModel.IsDel;
            parameters[35].Value = ContactModel.remark;

            int rowsAffected;
            int EnterpriseID;

            using (SqlConnection sqlConn = DbHelperSQL.GetSqlConnection())
            {
                sqlConn.Open();
                SqlTransaction sqlTran = sqlConn.BeginTransaction();
                try
                {
                    //插入信息
                    DbHelperSQL.RunProcedure(sqlConn, sqlTran, "UP_EnterpriseTab_Update", parameters, out rowsAffected);
                    if (rowsAffected > 0)
                    {
                        EnterpriseID = (int)parameters[0].Value;
                    }
                    else
                    {
                        EnterpriseID = 0;
                    }

                    Tz888.SQLServerDAL.Register.common obj2 = new common();
                    if (ContactManModels != null)
                    {
                        for (int i = 0; i < ContactManModels.Count; i++)
                        {
                            if (ContactManModels[i].Name != "" && ContactManModels[i].Name != null)
                            {
                                foreach (Tz888.Model.Register.OrgContactMan cm in ContactManModels)
                                {
                                    // model.ContactID = ContactID;
                                    if (!obj2.InsertContactMan(sqlConn, sqlTran, cm))
                                    {
                                        throw new Exception();
                                    }
                                }
                            }
                        }
                    }

                    if (infoResourceModels != null)
                    {
                        //图片资源
                        Tz888.SQLServerDAL.MemberResourceDAL obj3 = new MemberResourceDAL();
                        foreach (Tz888.Model.MemberResourceModel modelRes in infoResourceModels)
                        {
                            modelRes.LoginName = model.LoginName;
                            int i = obj3.Add(sqlConn, sqlTran, modelRes);
                        }
                    }
                    sqlTran.Commit();
                }
                catch
                {
                    sqlTran.Rollback();
                    EnterpriseID = -1;
                }
                finally
                {
                    sqlConn.Close();
                }
            }
            return(EnterpriseID);
        }
Ejemplo n.º 4
0
    protected void buSend_Click(object sender, ImageClickEventArgs e)
    {
        obj  = new EnterpriseRegisterBLL();
        mode = new EnterpriseInfoModel();

        List <Tz888.Model.Common.IndustryModel>   industryModels   = new List <Tz888.Model.Common.IndustryModel>();    //行业实体列表
        List <Tz888.Model.Register.OrgContactMan> ContactManModels = new  List <Tz888.Model.Register.OrgContactMan>(); //联系人实体列表

        Tz888.Model.Register.OrgContactModel   ContactModel       = new Tz888.Model.Register.OrgContactModel();        //创建信息联系方式主体
        List <Tz888.Model.MemberResourceModel> infoResourceModels = new List <Tz888.Model.MemberResourceModel>();      //图片资料

        mode.LoginName      = this.ViewState["MemberLoginName"].ToString();
        mode.EnterpriseName = tbEnterpriseName.Text;
        mode.SetComTypeID   = Convert.ToInt32(ddManageType.SelectedValue);
        try
        {
            mode.RegisterDate = Convert.ToDateTime(tbRegisterDate.Text);
        }
        catch
        {
            Tz888.Common.MessageBox.Show(this.Page, "注册时间输入错误");
            return;
        }
        mode.CountryCode = this.ZoneSelectControl1.CountryID;
        mode.ProvinceID  = this.ZoneSelectControl1.ProvinceID;
        mode.CityID      = this.ZoneSelectControl1.CityID;
        mode.CountyID    = this.ZoneSelectControl1.CountyID;
        if (mode.ProvinceID == "" && mode.CountryCode.Trim() == "CN")
        {
            Tz888.Common.MessageBox.Show(this.Page, "请选取更详细的注册地址");
            return;
        }

        industryModels = this.SelectIndustryControl1.IndustryModels;
        if (industryModels == null)
        {
            Tz888.Common.MessageBox.Show(this.Page, "行业不能为空");
            return;
        }
        foreach (Tz888.Model.Common.IndustryModel IM in industryModels)
        {
            mode.Industrylist += IM.IndustryBID + ",";
        }
        mode.currency = ddlCapitalCurrency.SelectedValue;//币种
        try
        {
            mode.RegCapital = Convert.ToDecimal(tbRegCapital.Text);//注册资金
        }
        catch
        {
            Tz888.Common.MessageBox.Show(this.Page, "请正确输入注册资金!");
            return;
        }
        #region 主营产品或服务

        string MainProduct = "";
        if (!string.IsNullOrEmpty(this.tbMainProduct1.Text.Trim()))
        {
            MainProduct += this.tbMainProduct1.Text.Trim() + ",";
        }
        if (!string.IsNullOrEmpty(this.tbMainProduct2.Text.Trim()))
        {
            MainProduct += this.tbMainProduct2.Text.Trim() + ",";
        }
        if (!string.IsNullOrEmpty(this.tbMainProduct3.Text.Trim()))
        {
            MainProduct += this.tbMainProduct3.Text.Trim() + ",";
        }
        mode.MainProduct = MainProduct;
        #endregion

        #region  读取意向
        Tz888.BLL.Conn objReq = new Tz888.BLL.Conn();
        string         req    = "";
        DataTable      dtReq  = objReq.GetList("logininfotab", "RequirInfo", "LoginName", 1, 1, 0, 1, "LoginName='" + this.ViewState["MemberLoginName"].ToString() + "'");
        if (dtReq != null)
        {
            req = dtReq.Rows[0]["RequirInfo"].ToString().Trim();
        }
        #endregion

        mode.RequirInfo     = req; //意向(从注册表里读取)
        mode.AuditingStatus = 0;   //审核状态

        if (tbComAbout.Text.Length < 50 || tbComAbout.Text.Length > 2000)
        {
            Tz888.Common.MessageBox.Show(this.Page, "请输入50-2000的公司介绍信息!");
            return;
        }

        mode.ComAbout = Tz888.Common.Utility.PageValidate.TxtToHtml(tbComAbout.Text);//公司介绍

        mode.ComAboutBrief  = "";
        mode.ExhibitionHall = tbExhibitionHall.Text; //展厅tbExhibitionHall
        mode.hits           = 0;                     //点击数

        mode.remark = "";

        ContactModel     = this.OrgContactControl1.OrgContact;  //联系信息
        ContactManModels = this.OrgContactControl1.ContactMans; //联系人


        if (ContactModel.Name.Trim() == "" && ContactModel.TelNum.Trim() == "" && ContactModel.Mobile.Trim() == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "请输入完整的联系信息!");
            return;
        }

        //将已上传的图片从临时目录迁移到正式目录
        //infoResourceModels = Tz888.Common.InfoResourceManage.MemberImageTransfer("Image", "EnterpriseRegister", Tz888.Common.ResourceType.Image, Tz888.Common.MemberResourceProperty.RP0, ImageUploadControl1.InfoList);
        infoResourceModels = ImageUploadControl1.InfoList;

        ////展厅
        //if (this.ViewState["WebInfo"].ToString() == "1")
        //{
        //    bool IsVip = false;
        //    if (Page.User.IsInRole("GT1002")) IsVip = true;

        //    SelfCreateWeb.Model.DatabaseOperationStatus dos = new SelfCreateWeb.BLL.BSelfCreateWebInfo().AddSelfCreateWebInfo(new SelfCreateWeb.Model.MSelfCreateWebInfo(0, this.ViewState["MemberLoginName"].ToString(), "", 0, tbExhibitionHall.Text.Trim(), DateTime.Now, DateTime.Now), new SelfCreateWeb.ParameterMap.PSelfCreateWebInfo(false, true, false, false, true, false, false));
        //    if (dos == SelfCreateWeb.Model.DatabaseOperationStatus.Success)
        //    {
        //        new SelfCreateWeb.BLL.BSelfCreateWebInfo().InitPageParameter(this.ViewState["MemberLoginName"].ToString(), IsVip, false);
        //    }
        //    else
        //    {
        //        Tz888.Common.MessageBox.Show(this.Page, "此域名不可用,请重新输入!");
        //        return;
        //    }
        //}

        //信息
        int EnterpriseId = Convert.ToInt32(this.ViewState["EnterpriseID"]);

        int type = 0;
        //if (Page.User.IsInRole("GT1001"))   //普通会员

        //    type = 0;
        //else
        type = 1;


        if (EnterpriseId == 0)
        {
            int rv = obj.EnterpriseAdd(mode, ContactModel, ContactManModels, infoResourceModels);
            if (rv > 0)
            {
                Response.Redirect("OrgRegisterSucceed.aspx?type=" + type + "&reg=Ent_Add&web=" + tbExhibitionHall.Text + ".co.");
                // string para="type=" + type + "&reg=Ent_Add&web=" + tbExhibitionHall.Text + ".co.";
                //   Response.Redirect("EnterpriseRegister_additive.aspx?reg=Ent_Add&web=" + tbExhibitionHall.Text + ".co.");
            }
        }
        else
        {
            mode.EnterpriseID = EnterpriseId;
            int rv = obj.EnterpriseUpdate(mode, ContactModel, ContactManModels, infoResourceModels);
            Response.Redirect("OrgRegisterSucceed.aspx?type=" + type + "&reg=Ent_Update&web=" + tbExhibitionHall.Text + ".co.");
            // string para ="type=" + type + "&reg=Ent_Update&web=" + tbExhibitionHall.Text + ".co.";
            // Response.Redirect("EnterpriseRegister_additive.aspx?reg=Ent_Update&web=" + tbExhibitionHall.Text + ".co.");
        }
    }