private OAOfficeResDepartmentApplication GetData()
    {
        OAOfficeResDepartmentApplication oAOfficeResDepartmentApplication = new OAOfficeResDepartmentApplication();

        oAOfficeResDepartmentApplication.ACRecordID = Guid.Empty;
        oAOfficeResDepartmentApplication.ApplyDate  = ((this.txtApplyDate.Text.Trim() == "") ? DateTime.Now : Convert.ToDateTime(this.txtApplyDate.Text.Trim()));
        string personInfo = OAOfficeCommonClas.GetPersonInfo(base.UserCode, "i_bmdm");

        oAOfficeResDepartmentApplication.ApplyDepartment = ((personInfo == "") ? 0 : int.Parse(personInfo));
        oAOfficeResDepartmentApplication.ApplyMan        = base.UserCode;
        oAOfficeResDepartmentApplication.AuditState      = -1;
        oAOfficeResDepartmentApplication.CorpCode        = this.Session["CorpCode"].ToString();
        if (this.OperateType == "upd")
        {
            oAOfficeResDepartmentApplication.DARecordID = this.InStorageID;
        }
        else
        {
            oAOfficeResDepartmentApplication.DARecordID = Guid.NewGuid();
        }
        oAOfficeResDepartmentApplication.IsAbove    = "0";
        oAOfficeResDepartmentApplication.IsComplete = "0";
        oAOfficeResDepartmentApplication.IsSubmit   = "0";
        oAOfficeResDepartmentApplication.RecordDate = DateTime.Now;
        oAOfficeResDepartmentApplication.UserCode   = base.UserCode;
        oAOfficeResDepartmentApplication.Remark     = this.txtRemark.Text.Trim();
        return(oAOfficeResDepartmentApplication);
    }
    private void AddDisplay()
    {
        this.txtApplyDate.Text   = DateTime.Now.ToShortDateString();
        this.txtApplyPerson.Text = BooksCommonClass.GetUserName(base.UserCode);
        string personInfo = OAOfficeCommonClas.GetPersonInfo(base.UserCode, "i_bmdm");

        this.txtApplyDept.Text = BooksCommonClass.GetDepartmentName(int.Parse(personInfo));
    }
Example #3
0
    private void DisplayPersonRation()
    {
        DataTable personInfo = OAOfficeCommonClas.GetPersonInfo(this.UsePerson);

        if (personInfo.Rows.Count > 0)
        {
            DataRow  dataRow     = personInfo.Rows[0];
            decimal  d           = OAOfficeCommonClas.GetPersonRation(dataRow["PostAndRank"].ToString());
            string   personInfo2 = OAOfficeCommonClas.GetPersonInfo(this.UsePerson, "EnterCorpDate");
            DateTime dateTime    = (personInfo2 == "") ? DateTime.Now : Convert.ToDateTime(personInfo2);
            if (dateTime.Year < DateTime.Now.Year)
            {
                d *= DateTime.Now.Month;
            }
            else
            {
                d *= DateTime.Now.Month - dateTime.Month + 1;
            }
            this.txtPersonRation.Text = d.ToString("f2");
        }
    }
Example #4
0
    private bool IsPass()
    {
        decimal  d          = (this.txtPersonRation.Text.Trim() == "") ? 0m : Convert.ToDecimal(this.txtPersonRation.Text.Trim());
        string   personInfo = OAOfficeCommonClas.GetPersonInfo(this.UsePerson, "EnterCorpDate");
        DateTime dateTime   = (personInfo == "") ? DateTime.Now : Convert.ToDateTime(personInfo);
        string   text;

        if (dateTime.Year < DateTime.Now.Year)
        {
            text = string.Concat(new object[]
            {
                "datediff(yyyy,'",
                DateTime.Now,
                "',a.ApplyDate)=0 and UseMan='",
                this.UsePerson,
                "'"
            });
        }
        else
        {
            text = string.Concat(new object[]
            {
                "datediff(yyyy,'",
                DateTime.Now,
                "',a.ApplyDate)=0 and datediff(mm,'",
                dateTime,
                "',a.ApplyDate)>=0 and UseMan='",
                this.UsePerson,
                "'"
            });
        }
        if (this.OperateType == "upd")
        {
            text = text + " and b.PADRecordID<>" + this.RecordID;
        }
        decimal d2 = this.amAction.GetApplyStat(text) + ((this.HdnPrice.Value.Trim() == "") ? 0m : Convert.ToDecimal(this.HdnPrice.Value.Trim())) * ((this.txtNumber.Text.Trim() == "") ? 0m : Convert.ToDecimal(this.txtNumber.Text.Trim()));

        return(d >= d2);
    }