示例#1
0
        public int AddTreasuryPermit(TreasuryPermit model)
        {
            int           num        = 0;
            SqlConnection connection = new SqlConnection(SqlHelper.ConnectionString);

            connection.Open();
            SqlTransaction trans   = connection.BeginTransaction();
            StringBuilder  builder = new StringBuilder();

            try
            {
                builder.Append("insert into Sm_Treasury_Permit(");
                builder.Append("tpid,tcode,ptype,pcode)");
                builder.Append(" values (");
                builder.Append("@tpid,@tcode,@ptype,@pcode)");
                SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@tpid", SqlDbType.NVarChar, 50), new SqlParameter("@tcode", SqlDbType.NVarChar, 0x200), new SqlParameter("@ptype", SqlDbType.NVarChar, 0x40), new SqlParameter("@pcode", SqlDbType.NVarChar, 0x40) };
                commandParameters[0].Value = model.tpid;
                commandParameters[1].Value = model.tcode;
                commandParameters[2].Value = model.ptype;
                commandParameters[3].Value = model.pcode;
                num = SqlHelper.ExecuteNonQuery(trans, CommandType.Text, builder.ToString(), commandParameters);
                trans.Commit();
            }
            catch
            {
                trans.Rollback();
                connection.Close();
            }
            connection.Close();
            return(num);
        }
示例#2
0
    protected void SelectBranch(TreeNode Node)
    {
        string text = " where ptype='" + this.ddlType.SelectedValue + "'";

        if (this.tvTreasury.SelectedValue != "")
        {
            text = text + " and tcode=" + this.tvTreasury.SelectedValue;
        }
        if (this.ViewState["type"] == "0")
        {
            IList <TreasuryPermit> allTreasuryPermitByWhere = this.treasuryPermitBll.GetAllTreasuryPermitByWhere(text);
            using (IEnumerator <TreasuryPermit> enumerator = allTreasuryPermitByWhere.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    TreasuryPermit current = enumerator.Current;
                    if (current.pcode == Node.Value)
                    {
                        Node.Checked = true;
                    }
                }
                return;
            }
        }
        if (this.hdBranchList.Value.Contains(Node.Value))
        {
            Node.Checked = true;
        }
    }
示例#3
0
    protected void AddDefautPermit(string tcode)
    {
        TreasuryPermit treasuryPermit = new TreasuryPermit();

        treasuryPermit.pcode = base.UserCode;
        treasuryPermit.ptype = "Person";
        treasuryPermit.tcode = tcode;
        treasuryPermit.tpid  = Guid.NewGuid().ToString();
        TreasuryPermitBll treasuryPermitBll = new TreasuryPermitBll();

        treasuryPermitBll.AddTreasuryPermit(treasuryPermit);
    }
示例#4
0
        public int UpdateTreasuryPermit(TreasuryPermit model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update Sm_Treasury_Permit set ");
            builder.Append("tcode=@tcode,");
            builder.Append("ptype=@ptype,");
            builder.Append("pcode=@pcode");
            builder.Append(" where tpid=@tpid ");
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@tpid", SqlDbType.NVarChar, 50), new SqlParameter("@tcode", SqlDbType.NVarChar, 0x200), new SqlParameter("@ptype", SqlDbType.NVarChar, 0x40), new SqlParameter("@pcode", SqlDbType.NVarChar, 0x40) };
            commandParameters[0].Value = model.tpid;
            commandParameters[1].Value = model.tcode;
            commandParameters[2].Value = model.ptype;
            commandParameters[3].Value = model.pcode;
            return(SqlHelper.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters));
        }
示例#5
0
    public bool AddPermit(string[] uList, string type)
    {
        bool result = true;

        for (int i = 0; i < uList.Length; i++)
        {
            string text = uList[i];
            if (!string.IsNullOrEmpty(text))
            {
                TreasuryPermit treasuryPermit = new TreasuryPermit();
                treasuryPermit.tpid  = Guid.NewGuid().ToString();
                treasuryPermit.tcode = this.tvTreasury.SelectedValue;
                treasuryPermit.ptype = type;
                treasuryPermit.pcode = text;
                if (this.treasuryPermitBll.AddTreasuryPermit(treasuryPermit) == 0)
                {
                    result = false;
                }
            }
        }
        return(result);
    }
示例#6
0
 public int UpdateTreasuryPermit(TreasuryPermit model)
 {
     return(this.treasuryPermitService.UpdateTreasuryPermit(model));
 }
示例#7
0
 public int AddTreasuryPermit(TreasuryPermit model)
 {
     return(this.treasuryPermitService.AddTreasuryPermit(model));
 }