Exemple #1
0
        public int Add(fund_ReqinfoModle model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into fund_Reqinfo(");
            builder.Append("reqNum,PrjNum,amount,reqType,reqPeopNum,reqCause,reqDate,useDate,isInterest,isDefault,InterestNum,auditState,remark,IsContr)");
            builder.Append(" values (");
            builder.Append("@reqNum,@PrjNum,@amount,@reqType,@reqPeopNum,@reqCause,@reqDate,@useDate,@isInterest,@isDefault,@InterestNum,@auditState,@remark,@IsContr)");
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@reqNum", SqlDbType.NVarChar, 50), new SqlParameter("@PrjNum", SqlDbType.NVarChar, 50), new SqlParameter("@amount", SqlDbType.Decimal, 0x12), new SqlParameter("@reqType", SqlDbType.Int, 4), new SqlParameter("@reqPeopNum", SqlDbType.NVarChar, 50), new SqlParameter("@reqCause", SqlDbType.Text), new SqlParameter("@reqDate", SqlDbType.DateTime), new SqlParameter("@useDate", SqlDbType.DateTime), new SqlParameter("@isInterest", SqlDbType.Bit, 1), new SqlParameter("@isDefault", SqlDbType.Bit, 1), new SqlParameter("@InterestNum", SqlDbType.Decimal, 0x12), new SqlParameter("@auditState", SqlDbType.Int, 4), new SqlParameter("@remark", SqlDbType.Text), new SqlParameter("@IsContr", SqlDbType.Int, 4) };
            commandParameters[0].Value  = model.reqNum;
            commandParameters[1].Value  = model.PrjNum;
            commandParameters[2].Value  = model.amount;
            commandParameters[3].Value  = model.reqType;
            commandParameters[4].Value  = model.reqPeopNum;
            commandParameters[5].Value  = model.reqCause;
            commandParameters[6].Value  = model.reqDate;
            commandParameters[7].Value  = model.useDate;
            commandParameters[8].Value  = model.isInterest;
            commandParameters[9].Value  = model.isDefault;
            commandParameters[10].Value = model.InterestNum;
            commandParameters[11].Value = model.auditState;
            commandParameters[12].Value = model.remark;
            commandParameters[13].Value = model.IsContr;
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters));
        }
Exemple #2
0
        public void CommitEvent(object key)
        {
            fund_ReqinfoModle        model  = this.bll.GetModel(key.ToString());
            fund_AccountOperateModle modle2 = new fund_AccountOperateModle {
                Acredence   = Guid.NewGuid().ToString(),
                AccounType  = model.reqType,
                AccountMony = new decimal?(Convert.ToDecimal(model.amount.ToString())),
                RealMony    = new decimal?(Convert.ToDecimal(model.amount.ToString()))
            };
            PtYhmc modelById = new PtYhmc();

            modelById        = new PtYhmcBll().GetModelById(base.UserCode);
            modle2.DepID     = modelById.i_bmdm.ToString();
            modle2.SumitMan  = base.UserCode;
            modle2.SumiTime  = new DateTime?(DateTime.Now);
            modle2.IsAccount = 0;
            if (model.IsContr == 0)
            {
                modle2.contracnum = model.PrjNum;
                modle2.projnum    = "";
                modle2.AccountNum = this.GetConBankNum(model.PrjNum);
            }
            else
            {
                modle2.projnum    = model.PrjNum;
                modle2.contracnum = "";
                modle2.AccountNum = this.GetPriBankNum(model.PrjNum);
            }
            modle2.AccountMan  = string.Empty;
            modle2.AccountMark = model.remark.ToString();
            new fund_AccountOperateBLL().Add(modle2);
        }
    private void AddContract()
    {
        fund_ReqinfoModle contract = new fund_ReqinfoModle();

        this.InitContract(contract);
        this.Add(contract);
    }
Exemple #4
0
        public bool Exists(fund_ReqinfoModle model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select top 1 *from fund_Reqinfo ");
            builder.Append("where reqNum='" + model.reqNum + "'");
            return(SqlHelper.ExecuteQuery(CommandType.Text, builder.ToString(), null).Rows.Count > 0);
        }
Exemple #5
0
    private void InitUpdateAndQuery()
    {
        fund_ReqinfoModle model = this.fund_ReqinfoBll.GetModel(this.contractID);

        this.txtContractCode.Text   = model.reqNum;
        this.txtContractMoney.Value = ((!model.amount.HasValue) ? string.Empty : model.amount.ToString());
        this.txtStartDate.Text      = ((!model.reqDate.HasValue) ? string.Empty : Convert.ToDateTime(model.reqDate).ToShortDateString());
        this.txtEndDate.Text        = ((!model.useDate.HasValue) ? string.Empty : Convert.ToDateTime(model.useDate).ToShortDateString());
        this.txtMainItem.Text       = model.reqCause;
        this.txtNotes.Text          = model.remark;
        this.hdfusercode.Value      = ((model.reqPeopNum == null) ? string.Empty : model.reqPeopNum.ToString());
        this.txtUsercode.Value      = PageHelper.QueryUser(this, this.hdfusercode.Value);
        this.DroType.SelectedValue  = ((!model.IsContr.HasValue) ? "0" : model.IsContr.ToString());
        if (this.DroType.SelectedValue == "0")
        {
            this.HiddenField1.Value = ((model.PrjNum == null) ? string.Empty : model.PrjNum);
            this.txtContr.Value     = this.GetContrName(model.PrjNum.Trim());
            this.Pro1.Visible       = false;
            this.Pro2.Visible       = false;
            this.Pro3.Visible       = true;
            this.Pro4.Visible       = true;
        }
        else
        {
            this.hdnProjectCode.Value = ((model.PrjNum == null) ? string.Empty : model.PrjNum);
            this.txtProject.Value     = this.GetProName(model.PrjNum.Trim());
            this.Pro3.Visible         = false;
            this.Pro4.Visible         = false;
            this.Pro1.Visible         = true;
            this.Pro2.Visible         = true;
        }
        this.RadioButton1.Checked = model.isInterest;
        if (this.RadioButton1.Checked)
        {
            this.isshow.Visible       = true;
            this.RadioButton3.Enabled = true;
            this.RadioButton4.Enabled = true;
            this.RadioButton2.Checked = false;
        }
        else
        {
            this.isshow.Visible       = false;
            this.RadioButton3.Enabled = true;
            this.RadioButton4.Enabled = true;
        }
        this.RadioButton3.Checked = model.isDefault;
        if (this.RadioButton3.Checked)
        {
            this.RadioButton4.Checked = false;
        }
        else
        {
            this.RadioButton4.Checked = true;
            this.td2.Visible          = true;
            this.td1.Visible          = true;
        }
        this.TextBox1.Text = ((!model.InterestNum.HasValue) ? string.Empty : Convert.ToDecimal(model.InterestNum).ToString());
    }
    private void InitContract(fund_ReqinfoModle contract)
    {
        contract.reqNum = this.txtContractCode.Text.Trim();
        accBaise   accBaise = new accBaise();
        basieModel model    = accBaise.GetModel(1);

        if (model != null)
        {
            decimal arg_35_0 = model.borrowRate.Value;
        }
        if (!string.IsNullOrEmpty(this.txtContractMoney.Value.Trim()))
        {
            contract.amount = new decimal?(Convert.ToDecimal(this.txtContractMoney.Value.Trim()));
        }
        contract.auditState    = new int?(-1);
        contract.reqCause      = ((this.txtMainItem.Text.Trim() == null) ? string.Empty : this.txtMainItem.Text.Trim());
        contract.remark        = ((this.txtNotes.Text.Trim() == null) ? string.Empty : this.txtNotes.Text.Trim());
        this.hdfusercode.Value = base.UserCode;
        this.txtUsercode.Value = PageHelper.QueryUser(this, base.UserCode);
        contract.reqPeopNum    = ((this.hdfusercode.Value.Trim() == null) ? string.Empty : this.hdfusercode.Value.Trim());
        if (this.DroType.SelectedValue == "0")
        {
            contract.IsContr = new int?(0);
            contract.PrjNum  = ((this.HiddenField1.Value.ToLower().Trim() == null) ? string.Empty : this.HiddenField1.Value.ToLower().Trim());
        }
        else
        {
            contract.IsContr = new int?(1);
            contract.PrjNum  = ((this.hdnProjectCode.Value.ToLower().Trim() == null) ? string.Empty : this.hdnProjectCode.Value.ToLower().Trim());
        }
        if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim()))
        {
            contract.reqDate = new DateTime?(Convert.ToDateTime(this.txtStartDate.Text.Trim()));
        }
        if (!string.IsNullOrEmpty(this.txtEndDate.Text.Trim()))
        {
            contract.useDate = new DateTime?(Convert.ToDateTime(this.txtEndDate.Text.Trim()));
        }
        contract.reqType = new int?(int.Parse(this.DropDownList1.SelectedValue));
        if (this.RadioButton2.Checked)
        {
            contract.isInterest  = false;
            contract.isDefault   = false;
            contract.InterestNum = new decimal?(0m);
            return;
        }
        contract.isInterest = true;
        if (this.RadioButton3.Checked)
        {
            contract.isDefault   = true;
            contract.InterestNum = new decimal?(Convert.ToDecimal(this.TextBox1.Text));
            return;
        }
        contract.isDefault   = false;
        contract.InterestNum = new decimal?(Convert.ToDecimal(this.TextBox1.Text));
    }
    private void AddUserCodes(fund_ReqinfoModle contract)
    {
        List <string> list = new List <string>();

        list.Add(base.UserCode);
        if (base.UserCode != "00000000")
        {
            list.Add("00000000");
        }
    }
    private void UpdateContract()
    {
        fund_ReqinfoModle model = this.fund_ReqinfoBll.GetModel(this.contractID);

        this.InitContract(model);
        try
        {
            this.fund_ReqinfoBll.Update(model);
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.Append("alert('系统提示:\\n\\n修改成功')").Append(Environment.NewLine);
            stringBuilder.Append("winclose('fund_ReqinfoEdit', 'fund_ReqinfoList.aspx', true)");
            base.RegisterScript(stringBuilder.ToString());
        }
        catch (Exception)
        {
            base.RegisterScript("alert('系统提示:\\n\\n修改失败')");
        }
    }
Exemple #9
0
        public bool Update(fund_ReqinfoModle model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update fund_Reqinfo set ");
            builder.Append("PrjNum=@PrjNum,");
            builder.Append("amount=@amount,");
            builder.Append("reqType=@reqType,");
            builder.Append("reqPeopNum=@reqPeopNum,");
            builder.Append("reqCause=@reqCause,");
            builder.Append("reqDate=@reqDate,");
            builder.Append("useDate=@useDate,");
            builder.Append("isInterest=@isInterest,");
            builder.Append("isDefault=@isDefault,");
            builder.Append("InterestNum=@InterestNum,");
            builder.Append("auditState=@auditState,");
            builder.Append("remark=@remark,");
            builder.Append("IsContr=@IsContr");
            builder.Append(" where reqNum=@reqNum ");
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@PrjNum", SqlDbType.NVarChar, 50), new SqlParameter("@amount", SqlDbType.NVarChar, 50), new SqlParameter("@reqType", SqlDbType.Int, 4), new SqlParameter("@reqPeopNum", SqlDbType.VarChar, 50), new SqlParameter("@reqCause", SqlDbType.Text), new SqlParameter("@reqDate", SqlDbType.DateTime), new SqlParameter("@useDate", SqlDbType.DateTime), new SqlParameter("@isInterest", SqlDbType.Bit, 1), new SqlParameter("@isDefault", SqlDbType.Bit, 1), new SqlParameter("@InterestNum", SqlDbType.Decimal, 0x12), new SqlParameter("@auditState", SqlDbType.Int, 4), new SqlParameter("@remark", SqlDbType.Text), new SqlParameter("@IsContr", SqlDbType.Int, 4), new SqlParameter("@reqNum", SqlDbType.NVarChar, 50) };
            commandParameters[0].Value  = model.PrjNum;
            commandParameters[1].Value  = model.amount;
            commandParameters[2].Value  = model.reqType;
            commandParameters[3].Value  = model.reqPeopNum;
            commandParameters[4].Value  = model.reqCause;
            commandParameters[5].Value  = model.reqDate;
            commandParameters[6].Value  = model.useDate;
            commandParameters[7].Value  = model.isInterest;
            commandParameters[8].Value  = model.isDefault;
            commandParameters[9].Value  = model.InterestNum;
            commandParameters[10].Value = model.auditState;
            commandParameters[11].Value = model.remark;
            commandParameters[12].Value = model.IsContr;
            commandParameters[13].Value = model.reqNum;
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters) > 0);
        }
    private void Add(fund_ReqinfoModle contract)
    {
        fund_ReqinfoBll fund_ReqinfoBll = new fund_ReqinfoBll();

        try
        {
            if (fund_ReqinfoBll.Exists(contract))
            {
                base.RegisterScript("alert('系统提示:\\n\\n此资金申请编号已经存在')");
            }
            else
            {
                fund_ReqinfoBll.Add(contract);
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("alert('系统提示:\\n\\n添加成功')").Append(Environment.NewLine);
                stringBuilder.Append("winclose('fund_ReqinfoEdit', 'fund_ReqinfoList.aspx', true)");
                base.RegisterScript(stringBuilder.ToString());
            }
        }
        catch (Exception)
        {
            base.RegisterScript("alert('系统提示:\\n\\n添加失败')");
        }
    }
Exemple #11
0
        public fund_ReqinfoModle GetModel(string reqNum)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select  top 1 id,reqNum,PrjNum,amount,reqType,reqPeopNum,reqCause,reqDate,useDate,isInterest,isDefault,InterestNum,auditState,remark ,IsContr from fund_Reqinfo ");
            builder.Append(" where reqNum=@reqNum ");
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@reqNum", SqlDbType.NVarChar, 50) };
            commandParameters[0].Value = reqNum;
            fund_ReqinfoModle modle = new fund_ReqinfoModle();
            DataTable         table = SqlHelper.ExecuteQuery(CommandType.Text, builder.ToString(), commandParameters);

            if (table.Rows.Count <= 0)
            {
                return(null);
            }
            modle.id = table.Rows[0]["id"].ToString();
            if (table.Rows[0]["reqNum"].ToString() != "")
            {
                modle.reqNum = table.Rows[0]["reqNum"].ToString();
            }
            if (table.Rows[0]["PrjNum"].ToString() != "")
            {
                modle.PrjNum = table.Rows[0]["PrjNum"].ToString();
            }
            if (table.Rows[0]["amount"].ToString() != "")
            {
                modle.amount = new decimal?(decimal.Parse(table.Rows[0]["amount"].ToString()));
            }
            if (table.Rows[0]["reqType"].ToString() != "")
            {
                modle.reqType = new int?(int.Parse(table.Rows[0]["reqType"].ToString()));
            }
            modle.reqPeopNum = table.Rows[0]["reqPeopNum"].ToString();
            modle.reqCause   = table.Rows[0]["reqCause"].ToString();
            if (table.Rows[0]["reqDate"].ToString() != "")
            {
                modle.reqDate = new DateTime?(DateTime.Parse(table.Rows[0]["reqDate"].ToString()));
            }
            if (table.Rows[0]["useDate"].ToString() != "")
            {
                modle.useDate = new DateTime?(DateTime.Parse(table.Rows[0]["useDate"].ToString()));
            }
            if (table.Rows[0]["isInterest"].ToString() != "")
            {
                if ((table.Rows[0]["isInterest"].ToString() == "1") || (table.Rows[0]["isInterest"].ToString().ToLower() == "true"))
                {
                    modle.isInterest = true;
                }
                else
                {
                    modle.isInterest = false;
                }
            }
            if (table.Rows[0]["isDefault"].ToString() != "")
            {
                if ((table.Rows[0]["isDefault"].ToString() == "1") || (table.Rows[0]["isDefault"].ToString().ToLower() == "true"))
                {
                    modle.isDefault = true;
                }
                else
                {
                    modle.isDefault = false;
                }
            }
            if (table.Rows[0]["InterestNum"].ToString() != "")
            {
                modle.InterestNum = new decimal?(decimal.Parse(table.Rows[0]["InterestNum"].ToString()));
            }
            if (table.Rows[0]["auditState"].ToString() != "")
            {
                modle.auditState = new int?(int.Parse(table.Rows[0]["auditState"].ToString()));
            }
            modle.remark = table.Rows[0]["remark"].ToString();
            if (table.Rows[0]["IsContr"].ToString() != "")
            {
                modle.IsContr = new int?(int.Parse(table.Rows[0]["IsContr"].ToString()));
            }
            return(modle);
        }
Exemple #12
0
        public List <fund_ReqinfoModle> DataTableToList(DataTable dt)
        {
            List <fund_ReqinfoModle> list = new List <fund_ReqinfoModle>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    fund_ReqinfoModle item = new fund_ReqinfoModle {
                        id = dt.Rows[i]["id"].ToString()
                    };
                    if (dt.Rows[i]["reqNum"].ToString() != "")
                    {
                        item.reqNum = dt.Rows[i]["reqNum"].ToString();
                    }
                    if (dt.Rows[i]["PrjNum"].ToString() != "")
                    {
                        item.PrjNum = dt.Rows[i]["PrjNum"].ToString();
                    }
                    if (dt.Rows[i]["amount"].ToString() != "")
                    {
                        item.amount = new decimal?(decimal.Parse(dt.Rows[i]["amount"].ToString()));
                    }
                    if (dt.Rows[i]["reqType"].ToString() != "")
                    {
                        item.reqType = new int?(int.Parse(dt.Rows[i]["reqType"].ToString()));
                    }
                    item.reqPeopNum = dt.Rows[i]["reqPeopNum"].ToString();
                    item.reqCause   = dt.Rows[i]["reqCause"].ToString();
                    if (dt.Rows[i]["reqDate"].ToString() != "")
                    {
                        item.reqDate = new DateTime?(DateTime.Parse(dt.Rows[i]["reqDate"].ToString()));
                    }
                    if (dt.Rows[i]["useDate"].ToString() != "")
                    {
                        item.useDate = new DateTime?(DateTime.Parse(dt.Rows[i]["useDate"].ToString()));
                    }
                    if (dt.Rows[i]["isInterest"].ToString() != "")
                    {
                        if ((dt.Rows[i]["isInterest"].ToString() == "1") || (dt.Rows[i]["isInterest"].ToString().ToLower() == "true"))
                        {
                            item.isInterest = true;
                        }
                        else
                        {
                            item.isInterest = false;
                        }
                    }
                    if (dt.Rows[i]["isDefault"].ToString() != "")
                    {
                        if ((dt.Rows[i]["isDefault"].ToString() == "1") || (dt.Rows[i]["isDefault"].ToString().ToLower() == "true"))
                        {
                            item.isDefault = true;
                        }
                        else
                        {
                            item.isDefault = false;
                        }
                    }
                    if (dt.Rows[i]["InterestNum"].ToString() != "")
                    {
                        item.InterestNum = new decimal?(decimal.Parse(dt.Rows[i]["InterestNum"].ToString()));
                    }
                    if (dt.Rows[i]["auditState"].ToString() != "")
                    {
                        item.auditState = new int?(int.Parse(dt.Rows[i]["auditState"].ToString()));
                    }
                    if (dt.Rows[i]["IsContr"].ToString() != "")
                    {
                        item.IsContr = new int?(int.Parse(dt.Rows[i]["IsContr"].ToString()));
                    }
                    item.remark = dt.Rows[i]["remark"].ToString();
                    list.Add(item);
                }
            }
            return(list);
        }
Exemple #13
0
 public bool Update(fund_ReqinfoModle model)
 {
     return(this.dal.Update(model));
 }
Exemple #14
0
 public void Add(fund_ReqinfoModle model)
 {
     this.dal.Add(model);
 }
Exemple #15
0
 public bool Exists(fund_ReqinfoModle model)
 {
     return(this.dal.Exists(model));
 }