예제 #1
0
        protected void ibtnDeleteAll_Click(object sender, ImageClickEventArgs e)
        {
            string delId = "";

            //先遍历取得选中项

            for (int i = 0; i < this.rpCompany.Items.Count; i++)
            {
                CheckBox cbx = (CheckBox)(rpCompany.Items[i].FindControl("cbx"));
                Label    lbl = (Label)rpCompany.Items[i].FindControl("lbl");
                if (cbx != null || cbx.Text != "")
                {
                    if (cbx.Checked)
                    {
                        delId += lbl.Text + ",";
                    }
                }
            }
            //去掉最后一个,
            delId = (delId + ")").Replace(",)", "");
            IList check = delId.Split(',');

            for (int i = 0; i < check.Count; i++)
            {
                Factory factory = FactoryManager.getFactoryById(Convert.ToInt32(check[i]));
                if (factory != null)
                {
                    FactBankManager.deleteFactBankByfactId(factory.Id);
                    FactLinkmanManager.deleteFactLinkmanByfactId(factory.Id);
                    FactoryManager.deleteFactory(Convert.ToInt32(check[i]));
                }
            }
            dataBind();
        }
예제 #2
0
        //其他银行
        private void addbank()
        {
            string banklist = this.hidbank.Value;

            if (banklist != "")
            {
                string[] row  = null;
                string[] cell = null;
                EtNet_Models.FactBank factbank = null;
                if (banklist.IndexOf(',') >= 0)
                {
                    row = banklist.Split(',');
                }
                else
                {
                    row = new string[1] {
                        banklist
                    };
                }
                for (int i = 0; i < row.Length; i++)
                {
                    factbank             = new EtNet_Models.FactBank();
                    cell                 = row[i].Split('|');
                    factbank.Bank        = cell[0];
                    factbank.AccountId   = cell[1];
                    factbank.AccountName = cell[2];
                    factbank.Remark      = cell[3];
                    factbank.FactId      = FactoryManager.getLastOneID().Id;
                    FactBankManager.addFactBank(factbank);
                }
            }
        }
예제 #3
0
        //读取其他银行信息
        private void loadOtherLink()
        {
            string    id = Request.QueryString["id"].ToString();
            DataTable dt = FactBankManager.getList(Convert.ToInt32(id));

            if (dt.Rows.Count > 0)
            {
                HtmlTableRow  row  = null;
                HtmlTableCell cell = null;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    row = new HtmlTableRow();

                    cell           = new HtmlTableCell();
                    cell.InnerHtml = dt.Rows[i]["bank"].ToString();
                    row.Controls.Add(cell);

                    cell           = new HtmlTableCell();
                    cell.InnerHtml = dt.Rows[i]["accountId"].ToString();
                    row.Controls.Add(cell);

                    cell           = new HtmlTableCell();
                    cell.InnerHtml = dt.Rows[i]["accountName"].ToString();
                    row.Controls.Add(cell);

                    cell           = new HtmlTableCell();
                    cell.InnerHtml = dt.Rows[i]["remark"].ToString();
                    row.Controls.Add(cell);

                    this.tablebank.Controls.Add(row);
                }
            }
        }
예제 #4
0
        //加载银行信息
        private void loadbank()
        {
            string id = Request.QueryString["id"].ToString();

            DataTable tbl = FactBankManager.getList(Convert.ToInt32(id));

            if (tbl.Rows.Count >= 1)
            {
                HtmlTableRow  row  = null;
                HtmlTableCell cell = null;
                for (int i = 0; i < tbl.Rows.Count; i++)
                {
                    if (i == 0)
                    {
                        row            = this.tablebank.Controls[1] as HtmlTableRow;
                        cell           = row.Controls[0] as HtmlTableCell;
                        cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["bank"] + "' class='clsblurtxt clsedit' />";
                        cell           = row.Controls[1] as HtmlTableCell;
                        cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["accountId"] + "' class='clsblurtxt clsedit' />";
                        cell           = row.Controls[2] as HtmlTableCell;
                        cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["accountName"] + "' class='clsblurtxt clsedit' />";
                        cell           = row.Controls[3] as HtmlTableCell;
                        cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["remark"] + "' class='clsblurtxt clsedit' />";
                    }
                    else
                    {
                        row            = new HtmlTableRow();
                        cell           = new HtmlTableCell();
                        cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["bank"] + "' class='clsblurtxt clsedit' />";
                        row.Controls.Add(cell);
                        cell           = new HtmlTableCell();
                        cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["accountId"] + "' class='clsblurtxt clsedit' />";
                        row.Controls.Add(cell);
                        cell           = new HtmlTableCell();
                        cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["accountName"] + "' class='clsblurtxt clsedit' />";
                        row.Controls.Add(cell);
                        cell           = new HtmlTableCell();
                        cell.InnerHtml = "<input type='text' value='" + tbl.Rows[i]["remark"] + "' class='clsblurtxt clsedit' />";
                        row.Controls.Add(cell);
                        cell = new HtmlTableCell();

                        cell.InnerHtml = "<div title='删除' class='clsimgdel'>&nbsp;</div>";
                        row.Controls.Add(cell);
                        this.tablebank.Controls.Add(row);
                    }
                }
            }
        }
예제 #5
0
        private void bank()
        {
            string           id       = Request.QueryString["id"].ToString();
            IList <FactBank> factbank = FactBankManager.getFactBankByFacrId(Convert.ToInt32(id));

            if (factbank.Count == 0)
            {
                tip.InnerHtml = "<div style='line-height:60px;height:60px;width:100%;text-align:center;'><p style='color:gray;width:200px;margin:0 auto;background:#FFFFFF;border:solid 0px #ccc; text-algin:center'><p></div>";
            }
            else
            {
                banklist.DataSource = factbank;
            }

            banklist.DataBind();
        }
예제 #6
0
 protected void rpCompany_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "Delete")
     {
         int id = Convert.ToInt32(e.CommandArgument);
         FactBankManager.deleteFactBankByfactId(id);
         FactLinkmanManager.deleteFactLinkmanByfactId(id);
         int count = FactoryManager.deleteFactory(id);
         if (count <= 0)
         {
             ClientScript.RegisterClientScriptBlock(this.GetType(), "page", "alert('删除失败')", true);
             return;
         }
     }
     dataBind();
 }
예제 #7
0
        private void addbank()
        {
            string id = Request.QueryString["id"].ToString();

            FactBankManager.deleteFactBankByfactId(Convert.ToInt32(id));

            string banklist = this.hidbank.Value;

            if (banklist != "")
            {
                string[] row  = null;
                string[] cell = null;
                EtNet_Models.FactBank factbank = null;
                if (banklist.IndexOf(',') >= 0)
                {
                    row = banklist.Split(',');
                }
                else
                {
                    row = new string[1] {
                        banklist
                    };
                }
                for (int i = 0; i < row.Length; i++)
                {
                    factbank             = new EtNet_Models.FactBank();
                    cell                 = row[i].Split('|');
                    factbank.Bank        = cell[0];
                    factbank.AccountId   = cell[1];
                    factbank.AccountName = cell[2];
                    factbank.Remark      = cell[3];
                    factbank.FactId      = Convert.ToInt32(id);
                    FactBankManager.addFactBank(factbank);
                }
            }
        }
예제 #8
0
        /// <summary>
        /// 加载收款帐号信息
        /// </summary>
        private void LoadGetAccount()
        {
            string factid = Request.QueryString["factid"];

            this.getAccount.Items.Clear();
            this.getAccount.Items.Add(new ListItem("——请选择——", "0"));
            DataTable dt = FactoryManager.getList(" id='" + factid + "'");

            if (dt.Rows.Count > 0)
            {
                ListItem item1 = new ListItem();
                item1.Text  = "开户银行:" + dt.Rows[0]["bank"].ToString() + ", 银行帐号:" + dt.Rows[0]["accountID"].ToString() + ", 开户名称:" + dt.Rows[0]["accountName"].ToString();
                item1.Value = dt.Rows[0]["bank"].ToString() + "," + dt.Rows[0]["accountID"].ToString() + "," + dt.Rows[0]["accountName"].ToString();
                this.getAccount.Items.Add(item1);
                DataTable tbl = FactBankManager.getList(int.Parse(dt.Rows[0]["id"].ToString()));
                for (int i = 0; i < tbl.Rows.Count; i++)
                {
                    ListItem adItem = new ListItem();
                    adItem.Text  = "开户银行:" + tbl.Rows[i]["bank"].ToString() + ", 银行帐号:" + tbl.Rows[i]["accountId"].ToString() + ", 开户名称:" + tbl.Rows[i]["accountName"].ToString();
                    adItem.Value = tbl.Rows[i]["bank"].ToString() + "," + tbl.Rows[i]["accountId"].ToString() + "," + tbl.Rows[i]["accountName"].ToString();
                    this.getAccount.Items.Add(adItem);
                }
            }
        }