Пример #1
0
    protected void setData(int classId)
    {
        DataTable dataTable = DocumentAction.QueryOneDocumentClass(classId);

        if (dataTable.Rows.Count == 1)
        {
            this.txtClassCode.Text = dataTable.Rows[0]["ClassCode"].ToString();
            this.txtClassName.Text = dataTable.Rows[0]["ClassName"].ToString();
            string text = dataTable.Rows[0]["IsValid"].ToString();
            if (text != "" && text != null)
            {
                this.ddltIsValid.ClearSelection();
                this.ddltIsValid.Items.FindByValue(text).Selected = true;
            }
        }
    }
Пример #2
0
    protected void BtnAdd_Click(object sender, EventArgs e)
    {
        string pStr = this.ddltIsValid.SelectedValue.ToString();
        string pStr2;

        if (this.Types == "0")
        {
            pStr2 = "%";
        }
        else
        {
            DataTable dataTable = DocumentAction.QueryCorpCode(this.UserCode);
            if (dataTable.Rows.Count == 0)
            {
                pStr2 = "%";
            }
            else
            {
                pStr2 = dataTable.Rows[0]["CorpCode"].ToString();
            }
        }
        if (string.IsNullOrEmpty(this.txtClassCode.Text.Trim()))
        {
            this.JS.Text = "alert('分类编号不允许为空!');";
            this.txtClassCode.Focus();
            return;
        }
        if (string.IsNullOrEmpty(this.txtClassName.Text.Trim()))
        {
            this.JS.Text = "alert('分类名称不允许为空!');";
            this.txtClassName.Focus();
            return;
        }
        if (this.txtRemark.Text.Trim().Length > 100)
        {
            this.JS.Text = "alert('备注长度不许超过100个字符!');";
            this.txtRemark.Focus();
            return;
        }
        if (this.ClassID == 0)
        {
            DataTable dataTable2 = DocumentAction.QueryOneDocumentClasscode(this.txtClassCode.Text.Trim(), this.ClassTypeCode);
            if (dataTable2.Rows.Count > 0)
            {
                this.JS.Text = "alert('分类编号不允许重复!');";
                this.txtClassCode.Focus();
                return;
            }
            DataTable dataTable3 = DocumentAction.QueryOneDocumentClassname(this.txtClassName.Text.Trim(), this.ClassTypeCode);
            if (dataTable3.Rows.Count > 0)
            {
                this.JS.Text = "alert('分类名称不允许重复!')";
                this.txtClassName.Focus();
                return;
            }
        }
        else
        {
            DataTable dataTable4 = DocumentAction.QueryOneDocumentClass(this.ClassID);
            if (dataTable4.Rows.Count > 0)
            {
                string b  = dataTable4.Rows[0]["ClassCode"].ToString();
                string b2 = dataTable4.Rows[0]["ClassName"].ToString();
                if (this.txtClassCode.Text.Trim() != b)
                {
                    DataTable dataTable5 = DocumentAction.QueryOneDocumentClasscode(this.txtClassCode.Text.Trim(), this.ClassTypeCode);
                    if (dataTable5.Rows.Count > 0)
                    {
                        this.JS.Text = "alert('分类编号不允许重复!');";
                        this.txtClassCode.Focus();
                        return;
                    }
                }
                if (this.txtClassName.Text.Trim() != b2)
                {
                    DataTable dataTable6 = DocumentAction.QueryOneDocumentClassname(this.txtClassName.Text.Trim(), this.ClassTypeCode);
                    if (dataTable6.Rows.Count > 0)
                    {
                        this.JS.Text = "alert('分类名称不允许重复!')";
                        this.txtClassName.Focus();
                        return;
                    }
                }
            }
        }
        Hashtable hashtable = new Hashtable();

        hashtable.Add("ClassTypeCode", SqlStringConstructor.GetQuotedString(this.ClassTypeCode));
        hashtable.Add("CorpCode", SqlStringConstructor.GetQuotedString(pStr2));
        hashtable.Add("ClassCode", SqlStringConstructor.GetQuotedString(this.txtClassCode.Text.Trim()));
        hashtable.Add("ClassName", SqlStringConstructor.GetQuotedString(this.txtClassName.Text.Trim()));
        hashtable.Add("Remark", SqlStringConstructor.GetQuotedString(this.txtRemark.Text.Trim()));
        hashtable.Add("IsValid", SqlStringConstructor.GetQuotedString(pStr));
        if (this.ClassID == 0)
        {
            if (DocumentAction.AddDocClass(hashtable))
            {
                this.JS.Text = "successed('保存');";
                return;
            }
            this.JS.Text = "alert('保存失败!');";
            return;
        }
        else
        {
            string where = " where ClassID = '" + this.ClassID + " '";
            if (DocumentAction.UpdDocClass(hashtable, where))
            {
                this.JS.Text = "successed('保存');";
                return;
            }
            this.JS.Text = "alert('保存失败!');";
            return;
        }
    }
Пример #3
0
    protected void setData(string userCode)
    {
        DataTable dataTable = PersonnelAction.QueryPersonnelchInfoById(userCode);

        if (dataTable.Rows.Count == 1)
        {
            if (dataTable.Rows[0]["SuperordinateDuty"].ToString() != "")
            {
                int arg_5A_0 = (int)dataTable.Rows[0]["SuperordinateDuty"];
            }
            this.Labbm.Text       = PersonnelAction.getDeptName(System.Convert.ToInt32(this.DeptID.ToString()));
            this.labUserCode.Text = dataTable.Rows[0]["userCode"].ToString();
            this.labname.Text     = dataTable.Rows[0]["v_xm"].ToString();
            this.labAge.Text      = dataTable.Rows[0]["age"].ToString();
            if (dataTable.Rows[0]["Sex"].ToString() != "")
            {
                if (dataTable.Rows[0]["Sex"].ToString() == "1")
                {
                    this.labSex.Text = "男";
                }
                else
                {
                    this.labSex.Text = "女";
                }
            }
            this.LabNation.Text      = dataTable.Rows[0]["Nation"].ToString();
            this.LabEducational.Text = dataTable.Rows[0]["EducationalBackground"].ToString();
            this.Labhigt.Text        = dataTable.Rows[0]["Stature"].ToString();
            this.LabDuty.Text        = dataTable.Rows[0]["dutyname"].ToString();
            if (dataTable.Rows[0]["PositionLevel"].ToString() != "")
            {
                this.LabPositionLevel.Text = dataTable.Rows[0]["PositionLevel"].ToString() + "级";
            }
            if (dataTable.Rows[0]["PostAndRank"].ToString() != "")
            {
                this.LabPostAndRank.Text = OAOfficeCommonClas.GetPostAndRank(dataTable.Rows[0]["PostAndRank"].ToString());
            }
            this.LabAddress.Text         = dataTable.Rows[0]["Address"].ToString();
            this.LabRegisteredPlace.Text = dataTable.Rows[0]["RegisteredPlace"].ToString();
            if (dataTable.Rows[0]["ClassID"].ToString() != "")
            {
                this.LabClassID.Text = DocumentAction.QueryOneDocumentClass(int.Parse(dataTable.Rows[0]["ClassID"].ToString())).Rows[0]["classname"].ToString();
            }
            this.LabComputeLevel.Text = dataTable.Rows[0]["ComputeLevel"].ToString();
            this.LabEnglishLevel.Text = dataTable.Rows[0]["EnglishLevel"].ToString();
            if (dataTable.Rows[0]["Marriage"].ToString() != "")
            {
                this.LabMarriage.Text = dataTable.Rows[0]["Marriage"].ToString();
            }
            this.LabPostcode.Text   = dataTable.Rows[0]["Postcode"].ToString();
            this.LabTel.Text        = dataTable.Rows[0]["Tel"].ToString();
            this.LabDriveLevel.Text = dataTable.Rows[0]["Drivelevel"].ToString();
            if (!string.IsNullOrEmpty(dataTable.Rows[0]["ExpectationSalary"].ToString()))
            {
                this.LabtExpectationSalary.Text = System.Convert.ToInt32(dataTable.Rows[0]["ExpectationSalary"]).ToString();
            }
            this.LabCommunicateAddress.Text = dataTable.Rows[0]["CommunicateAddress"].ToString();
            if (dataTable.Rows[0]["UserPhoto"].ToString() != "")
            {
                this.Image1.ImageUrl     = "~" + dataTable.Rows[0]["UserPhoto"].ToString();
                this.annexName.InnerText = dataTable.Rows[0]["v_xm"].ToString() + "照片";
            }
            else
            {
                this.Image1.ImageUrl = "~/images/PhotoDefault.gif";
            }
            this.LabMobilePhoneCode.Text = dataTable.Rows[0]["MobilePhoneCode"].ToString();
            if (!string.IsNullOrEmpty(dataTable.Rows[0]["Birthday"].ToString()))
            {
                this.LabBirthday.Text = System.DateTime.Parse(dataTable.Rows[0]["Birthday"].ToString()).ToShortDateString();
            }
            this.LabIDCard.Text       = dataTable.Rows[0]["IDCard"].ToString();
            this.LabPoliticsFace.Text = dataTable.Rows[0]["PoliticsFace"].ToString();
            if (!string.IsNullOrEmpty(dataTable.Rows[0]["JoinPartyDate"].ToString()))
            {
                this.LabJoinPartyDate.Text = System.DateTime.Parse(dataTable.Rows[0]["JoinPartyDate"].ToString()).ToShortDateString();
            }
            this.LabJoinCorpMode.Text   = dataTable.Rows[0]["JoinCorpMode"].ToString();
            this.LabIntroducer.Text     = dataTable.Rows[0]["Introducer"].ToString();
            this.LabSpecialty.Text      = dataTable.Rows[0]["Specialty"].ToString();
            this.LabGraduateSchool.Text = dataTable.Rows[0]["GraduateSchool"].ToString();
            this.LabLevel.Text          = dataTable.Rows[0]["Level"].ToString();
            if (!string.IsNullOrEmpty(dataTable.Rows[0]["BeginWorkDate"].ToString()))
            {
                this.LabBeginWorkDate.Text = System.DateTime.Parse(dataTable.Rows[0]["BeginWorkDate"].ToString()).ToShortDateString();
            }
            if (!string.IsNullOrEmpty(dataTable.Rows[0]["EnterCorpDate"].ToString()))
            {
                this.LabEnterCorpDate.Text = System.DateTime.Parse(dataTable.Rows[0]["EnterCorpDate"].ToString()).ToShortDateString();
            }
            this.LabtPostAndCompetency.Text = dataTable.Rows[0]["PostAndCompetency"].ToString();
            this.Labnowstata.Text           = dataTable.Rows[0]["statename"].ToString();
            if (dataTable.Rows[0]["EndowmentInsurance"].ToString() == "1")
            {
                this.cblInsurance.Items[0].Selected = true;
            }
            if (dataTable.Rows[0]["MedicareInsurance"].ToString() == "1")
            {
                this.cblInsurance.Items[1].Selected = true;
            }
            if (dataTable.Rows[0]["UnemploymentInsurance"].ToString() == "1")
            {
                this.cblInsurance.Items[2].Selected = true;
            }
            if (dataTable.Rows[0]["InjuryInsurance"].ToString() == "1")
            {
                this.cblInsurance.Items[3].Selected = true;
            }
            if (dataTable.Rows[0]["HousingAccumulationFund"].ToString() == "1")
            {
                this.cblInsurance.Items[4].Selected = true;
            }
            if (dataTable.Rows[0]["PersonSuddennessInsurance"].ToString() == "1")
            {
                this.cblInsurance.Items[5].Selected = true;
            }
            if (!string.IsNullOrEmpty(dataTable.Rows[0]["conEndDate"].ToString()))
            {
                this.labconEndDate.Text = System.Convert.ToDateTime(dataTable.Rows[0]["conEndDate"]).ToString("yyyy-MM-dd");
            }
            if (!string.IsNullOrEmpty(dataTable.Rows[0]["FormalDate"].ToString()))
            {
                this.labFormalData.Text = System.Convert.ToDateTime(dataTable.Rows[0]["FormalDate"].ToString()).ToString("yyyy-MM-dd");
            }
            this.laburgentCellMan.Text = dataTable.Rows[0]["urgentCellMan"].ToString();
            this.labucmConcern.Text    = dataTable.Rows[0]["ucmConcern"].ToString();
            this.labucmTel.Text        = dataTable.Rows[0]["ucmTel"].ToString();
            if (dataTable.Rows[0]["rdeNature"].ToString() != "")
            {
                this.labrdeNature.Text = dataTable.Rows[0]["rdeNature"].ToString();
            }
            if (dataTable.Rows[0]["IsChargeMan"].ToString() == "True")
            {
                this.labChargeMan.Text = "是";
                return;
            }
            this.labChargeMan.Text = "否";
        }
    }