protected void rabtnchange(object sender, EventArgs e)
    {
        accBaise   accBaise = new accBaise();
        basieModel model    = accBaise.GetModel(1);
        decimal    num;

        if (model != null)
        {
            num = model.borrowRate.Value;
        }
        else
        {
            num = 0m;
        }
        if (this.RadioButton1.Checked)
        {
            this.isshow.Visible       = true;
            this.RadioButton3.Enabled = true;
            this.RadioButton4.Enabled = true;
            this.TextBox1.Text        = num.ToString();
            return;
        }
        this.RadioButton3.Enabled = false;
        this.RadioButton4.Enabled = false;
        this.isshow.Visible       = false;
    }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         accBaise   accBaise   = new accBaise();
         basieModel basieModel = new basieModel();
         basieModel = accBaise.GetModel(1);
         if (basieModel != null)
         {
             if (basieModel.accAllot == 0)
             {
                 this.pr3.Visible = false;
                 this.pr4.Visible = false;
                 this.pr1.Visible = true;
                 this.pr2.Visible = true;
             }
             else
             {
                 this.pr1.Visible = false;
                 this.pr2.Visible = false;
                 this.pr3.Visible = true;
                 this.pr4.Visible = true;
             }
         }
         this.DataBindDrop();
         if (string.Compare(this.action, "Add", true) == 0)
         {
             this.InitAdd();
             return;
         }
         this.InitUpdateAndQuery();
     }
 }
    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));
    }
Exemple #4
0
    public void Bind(string selwhere)
    {
        accBaise   accBaise = new accBaise();
        basieModel model    = accBaise.GetModel(1);

        this.hdfaccAllot.Value      = model.accAllot.ToString();
        this.hdflimits.Value        = model.authority.ToString();
        this.gvwContract.DataSource = this.am.GetAcclist(selwhere, base.UserCode);
        this.gvwContract.DataBind();
        this.contract.Visible = true;
    }
Exemple #5
0
    public void Bind()
    {
        basieModel model = this.ab.GetModel(1);

        if (model.accAllot == 0)
        {
            this.rdbPrj.Checked = true;
        }
        else
        {
            if (model.accAllot == 1)
            {
                this.rdbCon.Checked = true;
            }
        }
        this.txtfundRatio.Text = model.fundRatio.ToString();
        if (model.startMoney == 0)
        {
            this.rdbPrjMoney.Checked = true;
        }
        else
        {
            if (model.startMoney == 1)
            {
                this.rdbCouMoney.Checked = true;
            }
        }
        if (model.isRate == 1)
        {
            this.rdbIsRate.Checked  = true;
            this.txtborrowRate.Text = model.borrowRate.ToString();
        }
        else
        {
            if (model.isRate == 0)
            {
                this.rdbNoRate.Checked = true;
                base.ClientScript.RegisterStartupScript(base.ClientScript.GetType(), "myscript", "<script>rdbNoRateClick();</script>");
            }
        }
        if (model.authority == 0)
        {
            this.rdbAuthPrj.Checked = true;
            return;
        }
        if (model.authority == 1)
        {
            this.rdbAuthHand.Checked = true;
        }
    }
Exemple #6
0
        public int Add(basieModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into fund_basic(");
            builder.Append("accAllot,fundRatio,isRate,borrowRate,authority,startMoney)");
            builder.Append(" values (");
            builder.Append("@accAllot,@fundRatio,@isRate,@borrowRate,@authority,@startMoney)");
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@accAllot", SqlDbType.Int, 4), new SqlParameter("@fundRatio", SqlDbType.Decimal, 9), new SqlParameter("@isRate", SqlDbType.Int, 4), new SqlParameter("@borrowRate", SqlDbType.Decimal, 9), new SqlParameter("@authority", SqlDbType.Int, 4), new SqlParameter("@startMoney", SqlDbType.Int, 4) };
            commandParameters[0].Value = model.accAllot;
            commandParameters[1].Value = model.fundRatio;
            commandParameters[2].Value = model.isRate;
            commandParameters[3].Value = model.borrowRate;
            commandParameters[4].Value = model.authority;
            commandParameters[5].Value = model.startMoney;
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters));
        }
Exemple #7
0
        public basieModel GetModel(int id)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("select id,accAllot,fundRatio,isRate,borrowRate,authority,startMoney from fund_basic ");
            builder.Append(" where id=@id");
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int, 4) };
            commandParameters[0].Value = id;
            DataTable  table = SqlHelper.ExecuteQuery(CommandType.Text, builder.ToString(), commandParameters);
            basieModel model = new basieModel();

            if (table.Rows.Count <= 0)
            {
                return(null);
            }
            if (table.Rows[0]["id"].ToString() != "")
            {
                model.id = int.Parse(table.Rows[0]["id"].ToString());
            }
            if (table.Rows[0]["accAllot"].ToString() != "")
            {
                model.accAllot = new int?(int.Parse(table.Rows[0]["accAllot"].ToString()));
            }
            if (table.Rows[0]["fundRatio"].ToString() != "")
            {
                model.fundRatio = new decimal?(decimal.Parse(table.Rows[0]["fundRatio"].ToString()));
            }
            if (table.Rows[0]["isRate"].ToString() != "")
            {
                model.isRate = new int?(int.Parse(table.Rows[0]["isRate"].ToString()));
            }
            if (table.Rows[0]["borrowRate"].ToString() != "")
            {
                model.borrowRate = new decimal?(decimal.Parse(table.Rows[0]["borrowRate"].ToString()));
            }
            if (table.Rows[0]["authority"].ToString() != "")
            {
                model.authority = new int?(int.Parse(table.Rows[0]["authority"].ToString()));
            }
            if (table.Rows[0]["startMoney"].ToString() != "")
            {
                model.startMoney = new int?(int.Parse(table.Rows[0]["startMoney"].ToString()));
            }
            return(model);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.DataBindDrop();
         if (string.Compare(this.action, "Add", true) == 0)
         {
             this.InitAdd();
         }
         else
         {
             this.InitUpdateAndQuery();
         }
         accBaise   accBaise = new accBaise();
         basieModel model    = accBaise.GetModel(1);
         if (model != null)
         {
             string value = model.fundRatio.ToString();
             this.hdfrate.Value = value;
             if (model.accAllot == 0)
             {
                 this.Pro1.Visible = true;
                 this.Pro2.Visible = true;
                 this.Pro3.Visible = false;
                 this.Pro4.Visible = false;
                 return;
             }
             this.Pro1.Visible = false;
             this.Pro2.Visible = false;
             this.Pro3.Visible = true;
             this.Pro4.Visible = true;
             return;
         }
         else
         {
             string value = "0";
             this.hdfrate.Value = value;
         }
     }
 }
Exemple #9
0
        public int Update(basieModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update fund_basic set ");
            builder.Append("accAllot=@accAllot,");
            builder.Append("fundRatio=@fundRatio,");
            builder.Append("isRate=@isRate,");
            builder.Append("borrowRate=@borrowRate,");
            builder.Append("authority=@authority,");
            builder.Append("startMoney=@startMoney");
            builder.Append(" where id=@id");
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@accAllot", SqlDbType.Int, 4), new SqlParameter("@fundRatio", SqlDbType.Decimal, 9), new SqlParameter("@isRate", SqlDbType.Int, 4), new SqlParameter("@borrowRate", SqlDbType.Decimal, 9), new SqlParameter("@authority", SqlDbType.Int, 4), new SqlParameter("@id", SqlDbType.Int, 4), new SqlParameter("@startMoney", SqlDbType.Int, 4) };
            commandParameters[0].Value = model.accAllot;
            commandParameters[1].Value = model.fundRatio;
            commandParameters[2].Value = model.isRate;
            commandParameters[3].Value = model.borrowRate;
            commandParameters[4].Value = model.authority;
            commandParameters[5].Value = model.id;
            commandParameters[6].Value = model.startMoney;
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters));
        }
Exemple #10
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        basieModel basieModel = new basieModel();

        if (this.rdbPrj.Checked)
        {
            basieModel.accAllot = new int?(0);
        }
        else
        {
            if (this.rdbCon.Checked)
            {
                basieModel.accAllot = new int?(1);
            }
        }
        if (this.txtfundRatio.Text != "")
        {
            basieModel.fundRatio = new decimal?(Convert.ToDecimal(this.txtfundRatio.Text));
        }
        else
        {
            basieModel.fundRatio = new decimal?(0m);
        }
        if (this.rdbIsRate.Checked)
        {
            basieModel.isRate = new int?(1);
        }
        else
        {
            if (this.rdbNoRate.Checked)
            {
                basieModel.isRate     = new int?(0);
                basieModel.borrowRate = new decimal?(0m);
            }
        }
        if (this.txtborrowRate.Text != "")
        {
            basieModel.borrowRate = new decimal?(Convert.ToDecimal(this.txtborrowRate.Text));
        }
        else
        {
            basieModel.borrowRate = new decimal?(0m);
        }
        if (this.rdbAuthPrj.Checked)
        {
            basieModel.authority = new int?(0);
        }
        else
        {
            if (this.rdbAuthHand.Checked)
            {
                basieModel.authority = new int?(1);
            }
        }
        if (this.rdbPrjMoney.Checked)
        {
            basieModel.startMoney = new int?(0);
        }
        else
        {
            if (this.rdbCouMoney.Checked)
            {
                basieModel.startMoney = new int?(1);
            }
        }
        basieModel.id = 1;
        int num = this.ab.upBaise(basieModel);

        if (num > 0)
        {
            base.RegisterScript("alert('系统提示:\\n\\修改成功!');");
            return;
        }
        base.RegisterScript("alert('系统提示:\\n\\修改失败!');");
    }
Exemple #11
0
 public int upBaise(basieModel model)
 {
     return(this.fb.Update(model));
 }
    protected void gvwContract_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        accBaise   accBaise = new accBaise();
        basieModel model    = accBaise.GetModel(1);
        string     value;

        if (model != null)
        {
            value = model.fundRatio.ToString();
        }
        else
        {
            value = "0";
        }
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string  text   = ((Label)e.Row.FindControl("lblname")).Text;
            string  value2 = ((HiddenField)e.Row.FindControl("hdfacid")).Value;
            string  text2  = ((Label)e.Row.FindControl("lblmony")).Text;
            string  a      = this.ViewState["type"].ToString();
            decimal num;
            if (a == "0")
            {
                num = System.Convert.ToDecimal(text2) * (System.Convert.ToDecimal(value) / 100m);
            }
            else
            {
                if (a == "1")
                {
                    num = System.Convert.ToDecimal(text2);
                }
                else
                {
                    if (a == "addoper")
                    {
                        num = System.Convert.ToDecimal(text2);
                    }
                    else
                    {
                        num = System.Convert.ToDecimal(text2);
                    }
                }
            }
            e.Row.Attributes["ondblclick"] = string.Concat(new object[]
            {
                "dbClickRow(this,'",
                this.gvwContract.DataKeys[e.Row.RowIndex].Values[0].ToString(),
                "','",
                this.gvwContract.DataKeys[e.Row.RowIndex].Values[4].ToString(),
                "','",
                text,
                "','",
                value2,
                "','",
                num,
                "', true)"
            });
            e.Row.Attributes["id"]             = this.gvwContract.DataKeys[e.Row.RowIndex].Value.ToString();
            e.Row.Attributes["guid"]           = this.gvwContract.DataKeys[e.Row.RowIndex].Value.ToString();
            e.Row.Attributes["isMainContract"] = this.gvwContract.DataKeys[e.Row.RowIndex].Values[1].ToString();
            e.Row.Attributes["prjGuid"]        = this.gvwContract.DataKeys[e.Row.RowIndex].Values[2].ToString();
            e.Row.Attributes["auditContent"]   = "支出合同 :" + this.gvwContract.DataKeys[e.Row.RowIndex].Values[3].ToString();
        }
    }