protected void bt_EditEvectionRoute_Click(object sender, EventArgs e)
    {
        ListTable<FNA_FeeWriteOffDetail> _details = new ListTable<FNA_FeeWriteOffDetail>(new FNA_FeeWriteOffBLL((int)ViewState["ID"]).Items, "ID");
        ViewState["Details"] = _details;

        BindGrid();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string title = ConfigHelper.GetConfigString("PageTitle");
            if (!String.IsNullOrEmpty(title))
            {
                lb_Header.Text = title;
            }

            #region 获取参数
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            ViewState["FeeType"] = Request.QueryString["FeeType"] == null ? 1 : int.Parse(Request.QueryString["FeeType"]);
            Session["FeeApplyDetail"] = null;
            Session["SuccessFlag"] = null;
            #endregion

            BindDropDown();

            #region 创建明细的列表
            ListTable<FNA_FeeApplyDetail> _details = new ListTable<FNA_FeeApplyDetail>(new FNA_FeeApplyBLL((int)ViewState["ID"]).Items, "ID");
            ViewState["Details"] = _details;
            #endregion

            BindData();

        }
    }
 protected void btn_Search_Click(object sender, EventArgs e)
 {
     if (select_Client.SelectValue == "" || select_Client.SelectValue == "0")
     {
         int level = int.Parse(ddl_Level.SelectedValue);
         string citys = "";
         DataTable dt = TreeTableBLL.GetAllChildNodeByNodes("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", tr_OrganizeCity.SelectValue);
         if (level > 0)
         {
             foreach (DataRow row in dt.Select("Level=" + level))
             {
                 citys += row["ID"] + ",";
             }
             citys = citys.Substring(0, citys.Length - 1);
         }
         else
             citys = tr_OrganizeCity.SelectValue;
         ListTable<PDT_ClassifyGiftCostRate> _details = new ListTable<PDT_ClassifyGiftCostRate>
                (PDT_ClassifyGiftCostRateBLL.GetModelList("OrganizeCity in (" + citys + ") "), "ID");
         ViewState["Details"] = _details;
     }
     else
     {
         ListTable<PDT_ClassifyGiftCostRate> _details = new ListTable<PDT_ClassifyGiftCostRate>
                (PDT_ClassifyGiftCostRateBLL.GetModelList("Client=" + select_Client.SelectValue), "ID");
         ViewState["Details"] = _details;
     }
     BindGrid();
 }
 protected void bt_OpenAdjust_Click(object sender, EventArgs e)
 {
     if (Session["SuccessFlag"] != null && (bool)Session["SuccessFlag"])
     {
         ListTable<FNA_FeeWriteOffDetail> _details = new ListTable<FNA_FeeWriteOffDetail>(new FNA_FeeWriteOffBLL((int)ViewState["ID"]).Items, "ID");
         ViewState["Details"] = _details;
         BindData();
     }
 }
Exemplo n.º 5
0
        public ListTable GetListTableBySlno(Int64 Slno)
        {
            Hashtable lstItems = new Hashtable();
            lstItems.Add("@Slno", Slno);

            DataTable dt = dal.GetAllListTableBySlno(lstItems);
            ListTable objListTable = new ListTable();
            DataRow dr = dt.Rows[0];
            return GetObject(dr);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Initialize instance
 /// </summary>
 public DocumentWriter()
 {
     Info = new Hashtable();
     DebugMode = true;
     CollectionInfo = true;
     ColorTable = new ColorTable();
     ListOverrideTable = new ListOverrideTable();
     ListTable = new ListTable();
     FontTable = new Table();
     ColorTable.CheckValueExistWhenAdd = true;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initialize instance from a file
 /// </summary>
 /// <param name="fileName"></param>
 public DocumentWriter(string fileName)
 {
     Info = new Hashtable();
     DebugMode = true;
     CollectionInfo = true;
     ColorTable = new ColorTable();
     ListOverrideTable = new ListOverrideTable();
     ListTable = new ListTable();
     FontTable = new Table();
     ColorTable.CheckValueExistWhenAdd = true;
     // ReSharper disable once DoNotCallOverridableMethodsInConstructor
     Open(fileName);
 }
Exemplo n.º 8
0
 /// <summary>
 /// initialize instance
 /// </summary>
 public DomDocument()
 {
     DefaultRowHeight = 400;
     FooterDistance = 720;
     HeaderDistance = 720;
     BottomMargin = 1440;
     RightMargin = 1800;
     TopMargin = 1440;
     LeftMargin = 1800;
     PaperHeight = 15840;
     PaperWidth = 12240;
     Info = new DocumentInfo();
     ListOverrideTable = new ListOverrideTable();
     ListTable = new ListTable();
     ColorTable = new ColorTable();
     FontTable = new Table();
     ChangeTimesNewRoman = false;
     Generator = null;
     LeadingChars = null;
     FollowingChars = null;
     OwnerDocument = this;
 }
        /// <summary>
        /// Listeaza training-urile unui angajat
        /// </summary>
        private void LoadFormIstoricTraining()
        {
            try
            {
                settings = Salaries.Configuration.ModuleConfig.GetSettings();
                UtilitiesDb utilDb = new UtilitiesDb(settings.ConnectionString);
                utilDb.CreateInternalTrainingSelectBox(this.lstTraining);
                if (this.lstTraining.Items.Count == 0)
                {
                    this.tipTraining.Items.RemoveAt(0);
                }
                utilDb.CreateExternalTrainingSelectBox(this.lstTraining2);
                if (this.lstTraining2.Items.Count == 0)
                {
                    this.tipTraining.Items.RemoveAt(1);
                }

                listTable.Rows.Clear();
                listTable2.Rows.Clear();

                listTable.Attributes.Add("width", "100%");
                listTable.Style.Add("border", "1px solid #20b2aa");
                listTable.Attributes.Add("cellpadding", "0");
                listTable.Attributes.Add("cellspacing", "1");

                listTable2.Attributes.Add("width", "100%");
                listTable2.Style.Add("border", "1px solid #20b2aa");
                listTable2.Attributes.Add("cellpadding", "0");
                listTable2.Attributes.Add("cellspacing", "1");


                Salaries.Business.IstoricTraining istTraining = new Salaries.Business.IstoricTraining();
                istTraining.AngajatId = AngajatID;

                string[] arHeader = { "Tip Training", "Descriere", "Diploma", "Data start", "Data end" };
                string[] arCols   = { "Nume", "Descriere", "Diploma", "DataStart", "DataEnd" };

                ListTable objListTable  = new ListTable(listTable, istTraining.LoadIstoricTraining(true), arHeader, arCols);
                ListTable objListTable2 = new ListTable(listTable2, istTraining.LoadIstoricTraining(false), arHeader, arCols);

                objListTable.textForEmptyDataSet  = "Nu exista nici un training intern asociat acestui angajat!";
                objListTable2.textForEmptyDataSet = "Nu exista nici un training extern  asociat acestui angajat!";

                string[] ar_OnClickParam     = { "IstoricTrainingID", "Intern", "TrainingID", "DataStart", "DataEnd", AngajatID.ToString() };
                string[] ar_OnClickParamType = { "dataset", "dataset", "dataset", "dataset", "dataset", "const" };

                objListTable.OnclickParams     = ar_OnClickParam;
                objListTable.OnclickParamsType = ar_OnClickParamType;
                objListTable.OnclickJSMethod   = "SelectTraining";

                objListTable2.OnclickParams     = ar_OnClickParam;
                objListTable2.OnclickParamsType = ar_OnClickParamType;
                objListTable2.OnclickJSMethod   = "SelectTraining";


                objListTable.DrawListTableWithoutDigits();
                objListTable2.DrawListTableWithoutDigits();
            }
            catch (Exception ex)
            {
                litError.Text  = "The following error occurred: <br>";
                litError.Text += ex.Message;
            }
        }
Exemplo n.º 10
0
    protected void bt_AddProduct_Click(object sender, EventArgs e)
    {
        #region 验证必填项
        if (ViewState["Product"] == null || (int)ViewState["Product"] == 0)
        {
            lb_ErrInfo1.Text = "产品必填!";
            return;
        }

        #endregion

        ListTable <PDT_ProductPrice_Detail> _details = ViewState["Details"] as ListTable <PDT_ProductPrice_Detail>;

        PDT_ProductPrice_Detail item;

        #region 产品存在与否判断
        if (ViewState["Selected"] == null)
        {
            //新增产品
            if (_details.Contains(ViewState["Product"].ToString()))
            {
                lb_ErrInfo1.Text = "该产品已添加!";
                return;
            }

            item         = new PDT_ProductPrice_Detail();
            item.Product = (int)ViewState["Product"];
        }
        else
        {
            //修改科目
            if (!_details.Contains(ViewState["Product"].ToString()))
            {
                lb_ErrInfo1.Text = "要修改的产品不存在!";
                return;
            }
            item = _details[ViewState["Selected"].ToString()];

            select_ProductCode.Enabled = true;
            gv_List.SelectedIndex      = -1;
        }
        #endregion

        lb_ProductName.ForeColor = System.Drawing.Color.Black;

        item.BuyingPrice = tbx_BuyingPrice.Text == "" ? 0 : decimal.Parse(tbx_BuyingPrice.Text);
        item.SalesPrice  = tbx_SalesPrice.Text == "" ? 0 : decimal.Parse(tbx_SalesPrice.Text);

        if (ViewState["Selected"] == null)
        {
            _details.Add(item);             //新增产品
        }
        else
        {
            _details.Update(item);          //更新产品
        }
        BindGrid();

        lb_ErrInfo1.Text     = "";
        tbx_BuyingPrice.Text = "";
        tbx_SalesPrice.Text  = "";

        ViewState["Selected"] = null;
    }
    private void BindGrid()
    {
        ListTable <CM_ContractDetail> _details = ViewState["Details"] as ListTable <CM_ContractDetail>;

        gv_Detail.BindGrid <CM_ContractDetail>(_details.GetListItem());
    }
Exemplo n.º 12
0
 public DeleteDeskHandle(ListTable listTable, Desk d)
 {
     this.listTable = listTable;
     this.d         = d;
 }
    protected bool bNoDelivery = false;      //未发货,界面发货数量字段可编辑

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["ID"]     = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            ViewState["Client"] = Request.QueryString["Client"] == null ? 0 : int.Parse(Request.QueryString["Client"]);
            BindDropDown();

            pn_OrderDelivery.SetPanelVisible("Panel_LGS_OrderDeliveryDetail00_02", false);

            if ((int)ViewState["ID"] == 0)
            {
                if ((int)ViewState["Client"] == 0)
                {
                    return;
                }

                #region 新增发货单时,初始化界面
                CM_Client client = new CM_ClientBLL((int)ViewState["Client"]).Model;
                if (client != null)
                {
                    ViewState["OrganizeCity"] = client.OrganizeCity;
                    Label lb_Client = (Label)pn_OrderDelivery.FindControl("ORD_OrderDelivery_Client");
                    if (lb_Client != null)
                    {
                        lb_Client.Text = client.FullName;
                    }

                    MCSSelectControl select_Store = (MCSSelectControl)pn_OrderDelivery.FindControl("ORD_OrderDelivery_Store");
                    if (select_Store != null && client.Supplier != 0)
                    {
                        select_Store.SelectText  = new CM_ClientBLL(client.Supplier).Model.FullName;
                        select_Store.SelectValue = client.Supplier.ToString();
                    }

                    TextBox tbx_DeliveryTime = (TextBox)pn_OrderDelivery.FindControl("ORD_OrderDelivery_DeliveryTime");
                    if (tbx_DeliveryTime != null)
                    {
                        tbx_DeliveryTime.Text = DateTime.Today.ToString("yyyy-MM-dd");
                    }

                    TextBox tbx_PreArrivalDate = (TextBox)pn_OrderDelivery.FindControl("ORD_OrderDelivery_PreArrivalDate");
                    if (tbx_PreArrivalDate != null)
                    {
                        tbx_PreArrivalDate.Text = DateTime.Today.AddDays(1).ToString("yyyy-MM-dd");
                    }



                    bNoDelivery       = true;
                    bt_Delete.Visible = false;
                }
                #endregion

                #region 创建空的列表
                ListTable <ORD_OrderDeliveryDetail> _details = new ListTable <ORD_OrderDeliveryDetail>
                                                                   (new List <ORD_OrderDeliveryDetail>(), "Product");
                DataTable dtProduct = ORD_OrderDeliveryBLL.InitProductList((int)ViewState["Client"], 0);
                foreach (DataRow row in dtProduct.Rows)
                {
                    ORD_OrderDeliveryDetail item = new ORD_OrderDeliveryDetail();
                    item.Product          = (int)row["Product"];
                    item.FactoryPrice     = (decimal)row["FactoryPrice"];
                    item.Price            = (decimal)row["SalesPrice"];
                    item.Client           = (int)ViewState["Client"];
                    item.DeliveryQuantity = 0;
                    item.SignInQuantity   = 0;
                    item.BadQuantity      = 0;
                    item.LostQuantity     = 0;

                    _details.Add(item);
                }

                ViewState["Details"] = _details;
                #endregion

                BindGrid();
            }
            else
            {
                BindData();
            }
        }
    }
    protected void bt_Save_Click(object sender, EventArgs e)
    {
        #region 判断预算余额是否够申请该项费用
        //if (((Dictionary_Data)ViewState["DicFeeType"]).Description == "BudgetControl" &&
        //    decimal.Parse(lb_BudgetBalance.Text) < decimal.Parse(lb_TotalCost.Text))
        //{
        //    MessageBox.Show(this, "对不起,您当前的预算余额不够申请该项费用!");
        //    return;
        //}
        #endregion

        if (gv_List.Rows.Count == 0)
        {
            MessageBox.Show(this, "对不起, 必须添加相应的费用明细!");
            return;
        }
        ListTable<FNA_FeeApplyDetail> _details = ViewState["Details"] as ListTable<FNA_FeeApplyDetail>;
        FNA_FeeApplyBLL bll;
        if ((int)ViewState["ID"] == 0)
            bll = new FNA_FeeApplyBLL();
        else
        {
            bll = new FNA_FeeApplyBLL((int)ViewState["ID"]);
            if (bll.Model.State != 1)
            {
                MessageBox.Show(this, "对不起,该申请单不为草稿状态,不能修改!");
                return;
            }
        }
        pn_FeeApply.GetData(bll.Model);

        bll.Model["Remark"] = tbx_Remark.Text.Replace("|", "");

        if ((int)ViewState["ID"] == 0)
        {
            bll.Model.SheetCode = FNA_FeeApplyBLL.GenerateSheetCode((int)ViewState["OrganizeCity"], (int)ViewState["AccountMonth"]);   //自动产生备案号
            bll.Model.AccountMonth = (int)ViewState["AccountMonth"];
            bll.Model.FeeType = (int)ViewState["FeeType"];
            bll.Model.OrganizeCity = (int)ViewState["OrganizeCity"];
            bll.Model["AccountTitle2"] = ViewState["AccountTitle2"].ToString() == "0" ? "" : ViewState["AccountTitle2"].ToString();
            bll.Model["ActivityID"] = ViewState["ActivityID"].ToString() == "0" ? "" : ViewState["ActivityID"].ToString();
            bll.Model["RelateCar"] = ViewState["RelateCar"].ToString() == "0" ? "" : ViewState["RelateCar"].ToString();
            bll.Model["FromGeneralFlow"] = ViewState["FromGeneralFlow"].ToString();

            bll.Model.ApproveFlag = 1;
            bll.Model.State = 1;
            bll.Model.InsertStaff = (int)Session["UserID"];

            bll.Items = _details.GetListItem();

            #region 费用申请时,一个申请单中只能申请一家店面费用时,将门店设置到Head表中
            try
            {
                if (!ConfigHelper.GetConfigBool("FeeApplyMutiClientsFee") && bll.Items.Count > 0)
                {
                    bll.Model.Client = bll.Items[0].Client;
                }
            }
            catch { }
            #endregion

            ViewState["ID"] = bll.Add();
        }
        else
        {
            bll.Model.UpdateStaff = (int)Session["UserID"];
            bll.Update();

            #region 修改明细
            bll.Items = _details.GetListItem(ItemState.Added);
            bll.AddDetail();

            foreach (FNA_FeeApplyDetail _deleted in _details.GetListItem(ItemState.Deleted))
            {
                bll.DeleteDetail(_deleted.ID);
            }

            bll.Items = _details.GetListItem(ItemState.Modified);
            bll.UpdateDetail();

            #endregion
        }

        if (sender != null)
        {
            MessageBox.ShowAndRedirect(this, "申请保存成功,请尽快点击“提交申请”按钮,否则本次申请未生效!", "FeeApplyDetail3.aspx?ID=" + ViewState["ID"].ToString());
        }
        else
        {
            //明细保存成功后,重置明细里各记录的新增、修改状态,以免重复新增
            ViewState["Details"] = new ListTable<FNA_FeeApplyDetail>(new FNA_FeeApplyBLL((int)ViewState["ID"]).Items, "ID");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ViewState["Client"] = Request.QueryString["Client"] == null ? 0 : int.Parse(Request.QueryString["Client"]);
            ViewState["OrganizeCity"] = Request.QueryString["OrganizeCity"] == null ? 0 : int.Parse(Request.QueryString["OrganizeCity"]);

            BindDropDown();

            if ((int)ViewState["Client"] != 0)
            {
                select_Client.SelectValue = ViewState["Client"].ToString();
                select_Client.SelectText = new CM_ClientBLL((int)ViewState["Client"]).Model.FullName;
            }
            else if ((int)ViewState["OrganizeCity"] != 0)
            {
                tr_OrganizeCity.SelectValue = ViewState["OrganizeCity"].ToString();
            }

            if (select_Client.SelectValue == "" || select_Client.SelectValue == "0")
            {
                int level = int.Parse(ddl_Level.SelectedValue);
                string citys = "";
                Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue));
                DataTable dt = TreeTableBLL.GetAllChildNodeByNodes("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", tr_OrganizeCity.SelectValue);
                if (level > 0)
                {
                    foreach (DataRow row in dt.Select("Level=" + level))
                    {
                        citys += row["ID"] + ",";
                    }
                    citys = citys.Substring(0, citys.Length - 1);
                }
                else citys = tr_OrganizeCity.SelectValue;
                ListTable<PDT_ClassifyGiftCostRate> _details = new ListTable<PDT_ClassifyGiftCostRate>
                       (PDT_ClassifyGiftCostRateBLL.GetModelList("OrganizeCity in (" + citys + ") "), "ID");
                ViewState["Details"] = _details;
            }
            else
            {
                ListTable<PDT_ClassifyGiftCostRate> _details = new ListTable<PDT_ClassifyGiftCostRate>
                       (PDT_ClassifyGiftCostRateBLL.GetModelList("Client=" + select_Client.SelectValue ), "ID");
                ViewState["Details"] = _details;
            }
            ViewState["MAXID"] = ((ListTable<PDT_ClassifyGiftCostRate>)ViewState["Details"]).GetListItem().Count > 0 ? ((ListTable<PDT_ClassifyGiftCostRate>)ViewState["Details"]).GetListItem().Max(p => p.ID) : 0;
            BindGrid();
        }
    }
Exemplo n.º 16
0
    private bool SaveGrid()
    {
        ListTable <FNA_FeeWriteOffDetail> _details = Session["FeeWriteOffDetails"] as ListTable <FNA_FeeWriteOffDetail>;

        foreach (GridViewRow row in gv_List.Rows)
        {
            int id                  = (int)gv_List.DataKeys[row.RowIndex]["ID"];
            int applydetailid       = (int)gv_List.DataKeys[row.RowIndex]["ApplyDetailID"];
            FNA_FeeWriteOffDetail m = _details[id.ToString()];

            #region 保存核销开始日期
            TextBox tbx_BeginDate = (TextBox)row.FindControl("tbx_BeginDate");
            if (tbx_BeginDate != null && tbx_BeginDate.Text != "")
            {
                DateTime begin = new DateTime(1900, 1, 1);

                if (DateTime.TryParse(tbx_BeginDate.Text, out begin))
                {
                    FNA_FeeApplyDetail apply = new FNA_FeeApplyBLL().GetDetailModel(applydetailid);
                    if (begin >= apply.BeginDate && begin <= apply.EndDate && begin <= m.EndDate)
                    {
                        m.BeginDate  = begin;
                        m.BeginMonth = AC_AccountMonthBLL.GetMonthByDate(begin);
                        _details.Update(m);
                    }
                    else
                    {
                        tbx_BeginDate.Text = m.BeginDate.ToString("yyyy-MM-dd");
                        MessageBox.Show(this, "第" + (row.RowIndex + 1).ToString() + "行,报销开始日期必须在该费用申请时指定的日期范围之内!" +
                                        apply.BeginDate.ToString("yyyy-MM-dd") + " — " + apply.EndDate.ToString("yyyy-MM-dd"));
                        return(false);
                    }
                }
                else
                {
                    tbx_BeginDate.Text = m.BeginDate.ToString("yyyy-MM-dd");
                    MessageBox.Show(this, "开始日期填写格式必需为日期型!");
                    return(false);
                }
            }
            #endregion

            #region 保存核销截止日期
            TextBox tbx_EndDate = (TextBox)row.FindControl("tbx_EndDate");
            if (tbx_EndDate != null && tbx_EndDate.Text != "")
            {
                DateTime end = new DateTime(1900, 1, 1);
                if (DateTime.TryParse(tbx_EndDate.Text, out end))
                {
                    FNA_FeeApplyDetail apply = new FNA_FeeApplyBLL().GetDetailModel(applydetailid);
                    if (end >= apply.BeginDate && end <= apply.EndDate && end >= m.BeginDate)
                    {
                        m.EndDate  = end;
                        m.EndMonth = AC_AccountMonthBLL.GetMonthByDate(end);
                        _details.Update(m);
                    }
                    else
                    {
                        tbx_EndDate.Text = m.EndDate.ToString("yyyy-MM-dd");
                        MessageBox.Show(this, "第" + (row.RowIndex + 1).ToString() + "行,报销截止日期必须在该费用申请时指定的日期范围之内!" +
                                        apply.BeginDate.ToString("yyyy-MM-dd") + " — " + apply.EndDate.ToString("yyyy-MM-dd"));
                        return(false);
                    }
                }
                else
                {
                    tbx_EndDate.Text = m.BeginDate.ToString("yyyy-MM-dd");
                    MessageBox.Show(this, "截止日期填写格式必需为日期型!");
                    return(false);
                }
            }
            #endregion
            m["DiscountRate"] = "0";
            m["RebateRate"]   = "0";
            //m["VATInvoiceNO"] = "";
            m["AcceptanceNO"] = "";
            m["InvoiceDate"]  = "";
            m["DeductReason"] = "";
            #region 结余方式
            //if (m.WriteOffCost < m.ApplyCost)
            //{
            //    DropDownList ddl_BalanceMode = (DropDownList)row.FindControl("ddl_BalanceMode");
            //    m.BalanceMode = int.Parse(ddl_BalanceMode.SelectedValue);
            //}
            //else
            m.BalanceMode = 2;//不允许多次核销
            #endregion

            #region  保存备注
            TextBox tbx_Remark = (TextBox)row.FindControl("tbx_Remark");
            m.Remark = tbx_Remark.Text;
            _details.Update(m);
            #endregion
        }

        return(true);
    }
Exemplo n.º 17
0
    private void BindFeeApplyNoWriteOff()
    {
        #region 组织查询条件
        string condition = " FNA_FeeApplyDetail.AvailCost > 0 ";
        condition += " AND FNA_FeeApply.OrganizeCity =" + ViewState["OrganizeCity"].ToString();

        condition += " AND FNA_FeeApplyDetail.BeginMonth >= " + ddl_BeginMonth.SelectedValue;
        condition += " AND FNA_FeeApplyDetail.EndMonth <= " + ddl_EndMonth.SelectedValue;

        if (ddl_FeeType.SelectedValue != "0")
        {
            condition += "AND FNA_FeeApply.FeeType=" + ddl_FeeType.SelectedValue;
        }
        if (!Right_Assign_BLL.GetAccessRight((string)Session["UserName"], 4703, "Browse"))
        {
            //无查看营养教育费用权限
            condition += " AND FNA_FeeApply.FeeType <> " + ConfigHelper.GetConfigInt("CSOCostType").ToString();
        }

        if (select_Client.SelectValue != "" && select_Client.SelectValue != "0")
        {
            condition += " AND FNA_FeeApplyDetail.Client=" + select_Client.SelectValue;
        }

        if (tbx_SheetCode.Text != "")
        {
            condition += " AND FNA_FeeApply.SheetCode like '%" + tbx_SheetCode.Text + "%'";
        }

        if (ddl_AccountTitle.SelectedValue != "0")
        {
            condition += " AND FNA_FeeApplyDetail.AccountTitle=" + ddl_AccountTitle.SelectedValue;
        }
        if ((int)ViewState["Client"] == 0)
        {
            condition += " AND FNA_FeeApply.Client IS NULL";
        }
        else
        {
            CM_ClientBLL _bll           = new CM_ClientBLL((int)ViewState["Client"]);
            string       clientconditon = "";
            if (_bll.Model["DIClassify"] == "1")
            {
                clientconditon = "SELECT ID FROM MCS_CM.dbo.CM_Client WHERE ID=" + ViewState["Client"].ToString() + "OR Supplier=" + ViewState["Client"].ToString() + " AND MCS_SYS.dbo.UF_Spilt(ExtPropertys,'|',7)='3'";
            }
            else
            {
                clientconditon = ViewState["Client"].ToString() + "," + _bll.Model.Supplier.ToString();
            }
            condition += " AND FNA_FeeApply.Client IN (" + clientconditon + ")";
        }


        #region 排除已选中到报销列表中的申请单
        string applydetailids = "";
        ListTable <FNA_FeeWriteOffDetail> _details = Session["FeeWriteOffDetails"] as ListTable <FNA_FeeWriteOffDetail>;
        foreach (FNA_FeeWriteOffDetail item in _details.GetListItem())
        {
            applydetailids += item.ApplyDetailID.ToString() + ",";
        }
        if (applydetailids != "")
        {
            applydetailids = applydetailids.Substring(0, applydetailids.Length - 1);
            condition     += " AND FNA_FeeApplyDetail.ID not in (" + applydetailids + ")";
        }
        #endregion

        #endregion

        gv_FeeAplyList.ConditionString = condition;
        gv_FeeAplyList.BindGrid();
    }
Exemplo n.º 18
0
    private void BindData()
    {
        PBM_OrderBLL bll = new PBM_OrderBLL((int)ViewState["ID"]);

        if (bll.Model != null)
        {
            pl_detail.BindData(bll.Model);

            ViewState["Client"]   = bll.Model.Client;
            ViewState["Supplier"] = bll.Model.Supplier;
            ViewState["Details"]  = new ListTable <PBM_OrderDetail>(bll.Items, "ID");
            ViewState["State"]    = bll.Model.State;
            ViewState["Classify"] = bll.Model.Classify;

            #region 绑定收款信息
            IList <PBM_OrderPayInfo> paylist = bll.GetPayInfoList();

            if (paylist.Count > 0)
            {
                ddl_PayMode1.SelectedValue = paylist[0].PayMode.ToString();
                tbx_PayAmount1.Text        = paylist[0].Amount.ToString("0.##");
            }
            if (paylist.Count > 1)
            {
                ddl_PayMode2.SelectedValue = paylist[1].PayMode.ToString();
                tbx_PayAmount2.Text        = paylist[1].Amount.ToString("0.##");
            }
            #endregion

            BindGrid();

            #region 界面控件可视状态
            if (bll.Model.State != 1 || bll.Model.ApproveFlag != 2)
            {
                bt_OK.Visible        = false;
                tb_AddDetail.Visible = false;
                bt_Delete.Visible    = false;
                tr_AddDetail.Visible = false;
                pl_detail.SetControlsEnable(false);

                gv_List.Columns[gv_List.Columns.Count - 1].Visible = false;
                gv_List.Columns[gv_List.Columns.Count - 2].Visible = false;

                ddl_PayMode1.Enabled   = false;
                ddl_PayMode2.Enabled   = false;
                tbx_PayAmount1.Enabled = false;
                tbx_PayAmount2.Enabled = false;
            }

            if (bll.Model.State != 1)
            {
                bt_Submit.Visible = false;
            }

            if (bll.Model.State != 2)
            {
                bt_Cancel.Visible = false;
                bt_Assign.Visible = false;
            }
            #endregion
        }
    }
Exemplo n.º 19
0
    protected void bt_AddToWriteOffList_Click(object sender, EventArgs e)
    {
        ListTable <FNA_FeeWriteOffDetail> _details = Session["FeeWriteOffDetails"] as ListTable <FNA_FeeWriteOffDetail>;
        int maxid = 0;

        if (_details != null)
        {
            if (_details.GetListItem().Count > 0)
            {
                maxid = _details.GetListItem().Max(p => p.ID);
            }
        }
        maxid++;

        foreach (GridViewRow row in gv_FeeAplyList.Rows)
        {
            CheckBox cb_Selected = (CheckBox)row.FindControl("cb_Selected");
            if (cb_Selected.Checked)
            {
                int applyid       = (int)gv_FeeAplyList.DataKeys[row.RowIndex][0];
                int applydetialid = (int)gv_FeeAplyList.DataKeys[row.RowIndex][1];

                FNA_FeeApplyBLL    applyBLL    = new FNA_FeeApplyBLL(applyid);
                FNA_FeeApply       apply       = applyBLL.Model;
                FNA_FeeApplyDetail applydetail = applyBLL.GetDetailModel(applydetialid);

                #region 陈列、返利费用判断协议是否关联合同
                IList <CM_Contract> contractList;
                contractList = CM_ContractBLL.GetModelList(@"ContractCode!='' AND ContractCode=MCS_SYS.dbo.UF_Spilt('" + applydetail.Remark + "',':',2)");
                if (applydetail.RelateContractDetail != 0)
                {
                    int ID = 0;
                    CM_ContractDetail detail = new CM_ContractBLL().GetDetailModel(applydetail.RelateContractDetail);
                    if (detail != null)
                    {
                        ID = detail.ContractID;
                    }
                    contractList = CM_ContractBLL.GetModelList("ID=" + ID.ToString());
                }

                if (contractList.Count > 0 && contractList[0].Classify < 3 && ATMT_AttachmentBLL.GetModelList("RelateType=35 AND RelateID=" + contractList[0].ID.ToString()).Count == 0)
                {
                    MessageBox.Show(this, "陈列、返利费用操作费用核销申请时,门店协议必须上传附件,请上传后再核销!");
                    return;
                }
                #endregion

                FNA_FeeWriteOffDetail m = new FNA_FeeWriteOffDetail();
                m.ID            = maxid++;
                m.ApplyDetailID = applydetialid;
                m.Client        = applydetail.Client;
                m.AccountTitle  = applydetail.AccountTitle;
                m.ProductBrand  = apply.ProductBrand;
                m.ApplyCost     = applydetail.AvailCost;
                m.BeginMonth    = applydetail.BeginMonth;
                m.EndMonth      = applydetail.EndMonth;
                m.BeginDate     = applydetail.BeginDate;
                m.EndDate       = applydetail.EndDate;
                m.WriteOffCost  = applydetail.AvailCost;
                m.Remark        = applydetail.Remark;
                if (applydetail["BankVoucherNo"] != "")
                {
                    m.Remark += ",凭证:" + applydetail["BankVoucherNo"];
                }

                if (applydetail.Remark.IndexOf("是否CA") > 0)
                {
                    m.Remark = applydetail.Remark.Substring(applydetail.Remark.IndexOf("是否CA") - 1);
                }
                if (_details == null)
                {
                    _details = new ListTable <FNA_FeeWriteOffDetail>(new List <FNA_FeeWriteOffDetail>(), "ID");
                }
                _details.Add(m);
            }
        }

        BindGrid();
        gv_FeeAplyList.PageIndex = 0;
        BindFeeApplyNoWriteOff();
    }
Exemplo n.º 20
0
    protected void bt_AddDetail_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] == 0)
        {
            return;
        }
        PBM_OrderBLL _bll = new PBM_OrderBLL((int)ViewState["ID"]);

        if (ViewState["Details"] == null)
        {
            return;
        }
        ListTable <PBM_OrderDetail> Details = (ListTable <PBM_OrderDetail>)ViewState["Details"];

        int product = 0;

        int.TryParse(select_Product.SelectValue, out product);
        //int.TryParse(RadComboBox1.SelectedValue, out product);
        if (product != 0)
        {
            PDT_ProductBLL productbll = new PDT_ProductBLL(product, true);
            if (productbll.Model == null)
            {
                return;
            }
            if (productbll.Model.ConvertFactor == 0)
            {
                productbll.Model.ConvertFactor = 1;
                productbll.Update();
            }

            int     quantity = 0;
            decimal price    = 0;

            int.TryParse(tbx_Quantity.Text, out quantity);
            decimal.TryParse(tbx_Price.Text, out price);

            if (ddl_Unit.SelectedValue == "T")
            {
                //整件单位
                quantity = quantity * productbll.Model.ConvertFactor;
                price    = price / productbll.Model.ConvertFactor;
            }

            if (quantity == 0)
            {
                MessageBox.Show(this, "请填写数量!");
                return;
            }

            PBM_OrderDetail d = null;

            if (ViewState["SelectedDetail"] != null)
            {
                d = (PBM_OrderDetail)ViewState["SelectedDetail"];
            }
            else
            {
                d         = new PBM_OrderDetail();
                d.OrderID = (int)ViewState["ID"];

                if (Details.GetListItem().Count == 0)
                {
                    d.ID = 1;
                }
                else
                {
                    d.ID = Details.GetListItem().Max(p => p.ID) + 1;
                }
            }

            d.Product           = product;
            d.Price             = price;        //实际销售价
            d.DiscountRate      = 1;            //默认全价
            d.ConvertFactor     = productbll.Model.ConvertFactor;
            d.BookQuantity      = quantity;
            d.ConfirmQuantity   = quantity;
            d.DeliveredQuantity = 0;
            d.SalesMode         = int.Parse(ddl_SalesMode.SelectedValue);
            if (d.SalesMode == 2)
            {
                d.Price = 0;
            }

            if (ViewState["SelectedDetail"] != null)
            {
                Details.Update(d);
                ViewState["SelectedDetail"] = null;
                bt_AddDetail.Text           = "新 增";
                gv_List.SelectedIndex       = -1;
            }
            else
            {
                Details.Add(d);
            }

            tbx_Quantity.Text = "0";

            BindGrid();
        }
    }
 public ChangeStateClick(ListTable listTable, Desk d)
 {
     this.listTable = listTable;
     this.d         = d;
 }
Exemplo n.º 22
0
 private void _segmentValuesListTable_Loaded(object sender, RoutedEventArgs e)
 {
     _segmentValuesListTable = sender as ListTable;
 }
    protected void Repeater2_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            int[] ids = ViewState["ids"] as int[];
            ViewState["ID"] = ids[e.Item.ItemIndex];

            PBM_DeliveryBLL bll = new PBM_DeliveryBLL((int)ViewState["ID"]);
            if ((int)ViewState["ID"] == 0 || bll.Model == null) Response.Redirect("SaleOutList.aspx");
            if (Session["OwnerType"] != null && (int)Session["OwnerType"] == 3 && bll.Model.Supplier != (int)Session["OwnerClient"]) Response.Redirect("SaleOutList.aspx");

            ListTable<PBM_DeliveryDetail> listDelivery = new ListTable<PBM_DeliveryDetail>(bll.Items, "ID");
            ViewState["Details"] = listDelivery;

            //获取分页数量
            int totlaItem = ((ListTable<PBM_DeliveryDetail>)ViewState["Details"]).GetListItem().Count;
            int pageNum = (totlaItem / PRINTPAGESIZE) + (totlaItem % PRINTPAGESIZE == 0 ? 0 : 1);
            ViewState["TotalPageCount"] = pageNum;

            int[] intTemp = new int[pageNum];
            for (int i = 0; i < pageNum; i++) intTemp[i] = i;
            Repeater Repeater1 = (Repeater)e.Item.FindControl("Repeater1");
            if (intTemp.Count() > 0 && Repeater1 != null)
            {
                Repeater1.DataSource = intTemp;
                Repeater1.DataBind();
            }
            Literal _c = (Literal)e.Item.FindControl("lb_RepeaterNextPage2");
            if (e.Item.ItemIndex > 0 && _c != null) _c.Text = "<br/><div class='PageNext'></div><br/>";
        }
    }
        /*
         * /// <summary>
         * ///
         * /// </summary>
         * private void Page_ChangeMonitoring(object sender, RoutedEventArgs e)
         * {
         *      bool monitor = sender == _buttonMonitor;
         *
         *      // First mark the correct monitoring state
         *      foreach (Oltp.PageRow dataItem in _listTable._listView.SelectedItems)
         *              dataItem.IsMonitored = monitor;
         *
         *
         *      try
         *      {
         *              using (OltpLogicClient proxy = new OltpLogicClient())
         *              {
         *                      proxy.Service.Page_Save( Oltp.Prepare<Oltp.PageDataTable>(_pages) );
         *              }
         *      }
         *      catch (Exception ex)
         *      {
         *              // Failed, so cancel and display a message
         *              MessageBoxError("Pages could not be updated.", ex);
         *              _pages.RejectChanges();
         *              return;
         *      }
         *
         *      Oltp.PageRow[] rowsToIterate = new Oltp.PageRow[_listTable._listView.SelectedItems.Count];
         *      _listTable._listView.SelectedItems.CopyTo(rowsToIterate, 0);
         *
         *      foreach (Oltp.PageRow dataItem in rowsToIterate)
         *      {
         *              if (_filterCheckbox.IsChecked == false && !monitor)
         *              {
         *                      // Remove pages that have been unmonitored
         *                      dataItem.Delete();
         *                      _items.Remove(dataItem);
         *              }
         *              else
         *              {
         *                      ListViewItem item = _listTable._listView.ItemContainerGenerator.ContainerFromItem(dataItem) as ListViewItem;
         *
         *                      // Apply the correcy template
         *                      (this.Resources["NameTemplateSelector"] as MasterPagesLocal.NameTemplateSelector)
         *                              .ApplyTemplate(dataItem, item);
         *              }
         *      }
         *
         *      _pages.AcceptChanges();
         * }
         */
        #endregion

        private void _reservationListView_Loaded(object sender, RoutedEventArgs e)
        {
            _reservationListView = sender as ListTable;
        }
    /// <summary>
    /// 设置页面gv_ProductList控件中,调整金额是否只读
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 判断传入参数是否为SheetCode
            if (Request.QueryString["SheetCode"] != null)
            {
                string code = Request.QueryString["SheetCode"];

                IList<ORD_OrderApply> list = ORD_OrderApplyBLL.GetModelList("SheetCode='" + code + "'");
                if (list.Count > 0)
                {
                    Response.Redirect("OrderProductApplyDetail.aspx?ID=" + list[0].ID.ToString());
                }
                else
                    Response.Redirect("OrderApplyList.aspx");
            }
            #endregion
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);

            ViewState["Product"] = 0;

            #region 创建空的列表
            ListTable<ORD_OrderApplyDetail> _details = new ListTable<ORD_OrderApplyDetail>(new ORD_OrderApplyBLL((int)ViewState["ID"]).Items, "Product");
            ViewState["Details"] = _details;
            #endregion

            if ( (int)ViewState["ID"]!=0)
            {
                BindData();
            }
            Header.Attributes["WebPageSubCode"] = "Type=" + ViewState["Type"].ToString();

        }
    }
Exemplo n.º 26
0
        public async Task <string> GetValue(BusinessBase obj)
        {
            string value = "";

            if (Type == PropertyInputType.date)
            {
                if (!(obj[FieldName] == null))
                {
                    if (obj.IsReadOnly(FieldName))
                    {
                        value = String.Format(Format, (DateTime)obj[FieldName]);
                    }
                    else
                    {
                        value = ((DateTime)obj[FieldName]).ToString("yyyy/MM/dd");
                    }
                }
            }
            else if (Type == PropertyInputType.datetimeHHmm)
            {
                if (!(obj[FieldName] == null))
                {
                    if (obj.IsReadOnly(FieldName))
                    {
                        value = String.Format(Format, (DateTime)obj[FieldName]);
                    }
                    else
                    {
                        value = ((DateTime)obj[FieldName]).ToString("yyyy/MM/dd HH:mm");
                    }
                }
            }
            else if (Type == PropertyInputType.datetimeHHmmss)
            {
                if (!(obj[FieldName] == null))
                {
                    if (obj.IsReadOnly(FieldName))
                    {
                        value = String.Format(Format, (DateTime)obj[FieldName]);
                    }
                    else
                    {
                        value = ((DateTime)obj[FieldName]).ToString("yyyy/MM/dd HH:mm:ss");
                    }
                }
            }
            else if (Type == PropertyInputType.checkbox || BasicType == BasicType.Bit)
            {
                value = obj[FieldName].NoNullBool() ? "1" : "0";
            }
            else if (Type == PropertyInputType.select)
            {
                if (obj[FieldName] == null)
                {
                    value = "0";
                }
                else
                {
                    value = obj[FieldName].ToString();
                }

                if (Required && value == "0" && !IsObjectView)
                {
                    // First element
                    ListTable dt = await obj.BusinessProvider.ListProvider.GetList(obj.ContextProvider, ListObjectName, ListName);

                    if (dt.ToClient.Count > 0)
                    {
                        value = dt.First[0].ToString();
                    }
                }
            }
            else
            {
                if (Format != "")
                {
                    value = String.Format(Format, obj[FieldName]);
                }
                else
                {
                    value = obj[FieldName].NoNullString();
                }
            }

            return(value);
        }
 protected void bt_CancelWriteOff_Click(object sender, EventArgs e)
 {
     FNA_FeeApplyBLL apply = new FNA_FeeApplyBLL((int)ViewState["ID"]);
     if (apply.Model.State == 3)
     {
         foreach (GridViewRow row in gv_List.Rows)
         {
             CheckBox cbx = row.FindControl("cb_Selected") == null ? null : row.FindControl("cb_Selected") as CheckBox;
             if (cbx.Visible && cbx.Checked)
             {
                 int detailid = (int)gv_List.DataKeys[row.RowIndex]["ID"];
                 FNA_FeeApplyDetail detail = apply.GetDetailModel(detailid);
                 detail.Flag = 3;
                 detail.Remark += "::取消时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + " 取消人:" + new Org_StaffBLL((int)Session["UserID"]).Model.RealName;
                 apply.UpdateDetail(detail);
             }
         }
         ListTable<FNA_FeeApplyDetail> _details = new ListTable<FNA_FeeApplyDetail>(new FNA_FeeApplyBLL((int)ViewState["ID"]).Items, "ID");
         ViewState["Details"] = _details;
         BindGrid();
     }
 }
Exemplo n.º 28
0
        public static void ExportToXml(DataTable dt, string file)
        {
            string newPath = CheckExport(dt, file, ".xml");

            switch (CurXmlMode)
            {
            case XmlMode.Excel:
            {
                StringWriter  dsw = new StringWriter();
                XmlTextWriter xw  = new XmlTextWriter(dsw);
                dt.WriteXml(xw, XmlWriteMode.WriteSchema);
                File.WriteAllText(newPath, dsw.ToString(), new UTF8Encoding(false));
                xw.Close();
                dsw.Close();
            }
            break;

            case XmlMode.Navicat:
            {
                XmlDocument    doc     = new XmlDocument();
                XmlDeclaration xmldecl = doc.CreateXmlDeclaration("1.0", "UTF-8", "yes");
                doc.AppendChild(xmldecl);
                XmlNode docNode = doc.CreateElement("RECORDS");
                doc.AppendChild(docNode);

                ListTable list = dt.ToListTable();
                foreach (List <object> objects in list.Rows)
                {
                    var node = doc.CreateElement("RECORD");
                    docNode.AppendChild(node);
                    var keys = new Queue <string>(list.Columns);
                    foreach (object o in objects)
                    {
                        var element = doc.CreateElement(keys.Dequeue());
                        //不赋值时空节点不换行
                        if (!string.IsNullOrEmpty(o.ToString()))
                        {
                            element.InnerText = o.ToString();
                        }
                        node.AppendChild(element);
                    }
                }

                ////是否输出为一行
                //doc.PreserveWhitespace = true;
                doc.Save(newPath);

                //XmlWriterSettings settings = new XmlWriterSettings();
                //settings.IndentChars = "";
                //settings.Indent = true;
                //using (XmlWriter xtw = XmlWriter.Create(newPath, settings))
                //{
                //    doc.Save(xtw);
                //}
            }
            break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            #endregion
        }
Exemplo n.º 29
0
    protected void bt_ConfirmSignIn_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] != 0)
        {
            ORD_OrderDeliveryBLL bll = new ORD_OrderDeliveryBLL((int)ViewState["ID"]);
            pn_OrderDelivery.GetData(bll.Model);
            if (bll.Model["SignInTime"] == "1900-01-01")
            {
                MessageBox.Show(this, "请选择实际到货日期!");
                return;
            }
            if (DateTime.Parse(bll.Model["SignInTime"]) > DateTime.Now)
            {
                MessageBox.Show(this, "实际到货日期不能大于今天!");
                return;
            }

            if (new CM_ClientBLL(bll.Model.Client).Model.ClientType == 2 && SVM_InventoryBLL.GetModelList("Client=" + bll.Model.Client.ToString() + " AND AccountMonth=" + bll.Model.AccountMonth.ToString() + " AND ApproveFlag=2").Count > 0)
            {
                MessageBox.ShowAndRedirect(this, "该经销商本月还有未审核库存,请先审核库存再作此操作。", "InventoryList.aspx?ClientID=" + bll.Model.Client.ToString());
                return;
            }

            ListTable <ORD_OrderDeliveryDetail> _details = ViewState["Details"] as ListTable <ORD_OrderDeliveryDetail>;

            #region 判断签收数量是否大于发放数量
            for (int i = 0; i < gv_OrderList.Rows.Count; i++)
            {
                int id = (int)gv_OrderList.DataKeys[i]["ID"];

                ORD_OrderDeliveryDetail m       = new ORD_OrderDeliveryBLL().GetDetailModel(id);
                PDT_Product             product = new PDT_ProductBLL(m.Product).Model;


                TextBox tbx_SignInQuantity_T = (TextBox)gv_OrderList.Rows[i].FindControl("tbx_SignInQuantity_T");
                TextBox tbx_SignInQuantity   = (TextBox)gv_OrderList.Rows[i].FindControl("tbx_SignInQuantity");

                TextBox tbx_BadQuantity_T = (TextBox)gv_OrderList.Rows[i].FindControl("tbx_BadQuantity_T");
                TextBox tbx_BadQuantity   = (TextBox)gv_OrderList.Rows[i].FindControl("tbx_BadQuantity");

                TextBox tbx_LostQuantity_T = (TextBox)gv_OrderList.Rows[i].FindControl("tbx_LostQuantity_T");
                TextBox tbx_LostQuantity   = (TextBox)gv_OrderList.Rows[i].FindControl("tbx_LostQuantity");

                int SignInQuantity = (int.Parse(tbx_SignInQuantity_T.Text) * product.ConvertFactor + int.Parse(tbx_SignInQuantity.Text));
                int BadQuantity    = (int.Parse(tbx_BadQuantity_T.Text) * product.ConvertFactor + int.Parse(tbx_BadQuantity.Text));
                int LostQuantity   = (int.Parse(tbx_LostQuantity_T.Text) * product.ConvertFactor + int.Parse(tbx_LostQuantity.Text));

                if (SignInQuantity < 0 || BadQuantity < 0 || LostQuantity < 0)
                {
                    MessageBox.Show(this, "对不起,产品:" + product.FullName + "签收、丢失、破损的数量不能小于0");
                    return;
                }
                if (SignInQuantity + BadQuantity + LostQuantity != m.DeliveryQuantity)
                {
                    MessageBox.Show(this, "对不起,产品:" + product.FullName + "签收、丢失、破损的数量必需等于实发数量" + GetQuantityString(m.Product, m.DeliveryQuantity));
                    return;
                }

                m.SignInQuantity = SignInQuantity;
                m.BadQuantity    = BadQuantity;
                m.LostQuantity   = LostQuantity;

                _details.Update(m);
            }
            #endregion


            bll.Model["SignInStaff"] = Session["UserID"].ToString();
            bll.Model.State          = 3; //已签收

            bll.Update();

            bll.Items = _details.GetListItem(ItemState.Modified);
            bll.UpdateDetail();

            MessageBox.ShowAndRedirect(this, "发货单签收成功!", "OrderDeliveryList.aspx");
        }
    }
Exemplo n.º 30
0
        private void ReadListTable(Reader reader)
        {
            ListTable = new ListTable();
            while (reader.ReadToken() != null)
            {
                if (reader.TokenType == RtfTokenType.GroupEnd)
                    break;

                if (reader.TokenType == RtfTokenType.GroupStart)
                {
                    var firstRead = true;
                    RtfList currentList = null;
                    var level = reader.Level;
                    while (reader.ReadToken() != null)
                    {
                        if (reader.TokenType == RtfTokenType.GroupEnd)
                        {
                            if (reader.Level < level)
                            {
                                break;
                            }
                        }
                        else if (reader.TokenType == RtfTokenType.GroupStart)
                        {
                            // if meet nested level , then ignore
                            //reader.ReadToken();
                            //ReadToEndGround(reader);
                            //reader.ReadToken();
                        }
                        if (firstRead)
                        {
                            if (reader.CurrentToken.Key != "list")
                            {
                                // 不是以list开头,忽略掉
                                ReadToEndGround(reader);
                                reader.ReadToken();
                                break;
                            }
                            currentList = new RtfList();
                            ListTable.Add(currentList);
                            firstRead = false;
                        }

                        switch (reader.CurrentToken.Key)
                        {
                            case "listtemplateid":
                                currentList.ListTemplateId = reader.CurrentToken.Param;
                                break;

                            case "listid":
                                currentList.ListId = reader.CurrentToken.Param;
                                break;

                            case "listhybrid":
                                currentList.ListHybrid = true;
                                break;

                            case "levelfollow":
                                currentList.LevelFollow = reader.CurrentToken.Param;
                                break;

                            case "levelstartat":
                                currentList.LevelStartAt = reader.CurrentToken.Param;
                                break;

                            case "levelnfc":
                                if (currentList.LevelNfc == RtfLevelNumberType.None)
                                    currentList.LevelNfc = (RtfLevelNumberType) reader.CurrentToken.Param;
                                break;

                            case "levelnfcn":
                                if (currentList.LevelNfc == RtfLevelNumberType.None)
                                    currentList.LevelNfc = (RtfLevelNumberType) reader.CurrentToken.Param;
                                break;

                            case "leveljc":
                                currentList.LevelJc = reader.CurrentToken.Param;
                                break;

                            case "leveltext":
                                if (string.IsNullOrEmpty(currentList.LevelText))
                                {
                                    var text = ReadInnerText(reader, true);
                                    if (text != null && text.Length > 2)
                                    {
                                        int len = text[0];
                                        len = Math.Min(len, text.Length - 1);
                                        text = text.Substring(1, len);
                                    }
                                    currentList.LevelText = text;
                                }
                                break;

                            case "f":
                                currentList.FontName = FontTable.GetFontName(reader.CurrentToken.Param);
                                break;
                        }
                    }
                }
            } 
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ViewState["PriceID"] = Request.QueryString["PriceID"] == null ? 0 : int.Parse(Request.QueryString["PriceID"]);
            ViewState["ClientType"] = Request.QueryString["ClientType"] == null ? 2 : int.Parse(Request.QueryString["ClientType"]); //客户类型,2:经销商,3:终端门店

            if ((int)ViewState["PriceID"] != 0)//修改客户销量
            {
                BindData();
            }
            else
            {
                #region 获取页面参数
                if (Request.QueryString["ClientID"] != null)
                {
                    ViewState["ClientID"] = int.Parse(Request.QueryString["ClientID"].ToString());
                }
                else if (Session["ClientID"] != null)
                {
                    ViewState["ClientID"] = (int)Session["ClientID"];
                }
                else
                {
                   Response.Redirect("PDT_ProductPrice.aspx");
                }
                #endregion
                tbx_begin.Text = DateTime.Now.ToString("yyyy-MM-dd");
                tbx_end.Text = DateTime.Now.AddMonths(36).ToString("yyyy-MM-dd");
                BindClient();
                btn_Delete.Visible = false;
            }

            Header.Attributes["WebPageSubCode"] = "ClientType=" + ViewState["ClientType"].ToString();
            #region 创建空列表
            ListTable<PDT_ProductPrice_Detail> _details = new ListTable<PDT_ProductPrice_Detail>(new PDT_ProductPriceBLL((int)ViewState["PriceID"]).Items, "Product");
            ViewState["Details"] = _details;
            BindGrid();
            #endregion
        }
    }
    protected void bt_AddDetail_Click(object sender, EventArgs e)
    {
        ListTable <CM_ContractDetail> _details = ViewState["Details"] as ListTable <CM_ContractDetail>;

        DateTime begindate     = new DateTime();
        DateTime enddate       = new DateTime();
        TextBox  tbx_BeginDate = pl_detail.FindControl("CM_Contract_BeginDate") == null ? null : (TextBox)pl_detail.FindControl("CM_Contract_BeginDate");
        TextBox  tbx_EndDate   = pl_detail.FindControl("CM_Contract_EndDate") == null ? null : (TextBox)pl_detail.FindControl("CM_Contract_EndDate");

        if (tbx_BeginDate != null && tbx_EndDate != null)
        {
            DateTime.TryParse(tbx_BeginDate.Text, out begindate);
            DateTime.TryParse(tbx_EndDate.Text, out enddate);
            if (enddate < begindate)
            {
                MessageBox.Show(this, "协议终止日期不能小于起始日期。");
                return;
            }
        }

        if (ddl_PayMode.SelectedValue == "0")
        {
            MessageBox.Show(this, "付款周期必选!");
            return;
        }


        CM_ContractDetail item;

        if (ViewState["Selected"] == null)
        {
            //新增科目
            if (_details.Contains(ddl_AccountTitle.SelectedValue))
            {
                MessageBox.Show(this, "该科目已添加!");
                return;
            }

            item = new CM_ContractDetail();
            item.AccountTitle = int.Parse(ddl_AccountTitle.SelectedValue);
            if (TreeTableBLL.GetChild("MCS_PUB.dbo.AC_AccountTitle", "ID", "SuperID", item.AccountTitle).Rows.Count > 0)
            {
                MessageBox.Show(this, "费用科目必须选择最底级会计科目!" + ddl_AccountTitle.SelectedItem.Text);
                return;
            }
        }
        else
        {//修改科目
            if (!_details.Contains(ddl_AccountTitle.SelectedValue))
            {
                MessageBox.Show(this, "要修改的项目不存在!");
                return;
            }
            item = _details[ViewState["Selected"].ToString()];
        }
        item.ApplyLimit = decimal.Parse(tbx_ApplyLimit.Text);
        if (item.ApplyLimit == 0)
        {
            MessageBox.Show(this, "对不起,月费用金额不能为0!");
            return;
        }
        item.PayMode = int.Parse(ddl_PayMode.SelectedValue);

        if (ViewState["Selected"] == null)
        {
            _details.Add(item);
        }
        else
        {
            _details.Update(item);
        }

        BindGrid();

        tbx_ApplyLimit.Text   = "0";
        bt_AddDetail.Text     = "新增";
        ViewState["Selected"] = null;
    }
Exemplo n.º 33
0
        private IValue Length(List <IValue> arguments, Scope s)
        {
            ListTable list = (ListTable)arguments.First();

            return(list.Count);
        }
Exemplo n.º 34
0
    private void BindData()
    {
        PBM_OrderBLL bll = new PBM_OrderBLL((int)ViewState["ID"]);
        if (bll.Model != null)
        {
            pl_detail.BindData(bll.Model);

            ViewState["Client"] = bll.Model.Client;
            ViewState["Supplier"] = bll.Model.Supplier;
            ViewState["Details"] = new ListTable<PBM_OrderDetail>(bll.Items, "ID");
            ViewState["State"] = bll.Model.State;
            ViewState["Classify"] = bll.Model.Classify;

            #region 绑定收款信息
            IList<PBM_OrderPayInfo> paylist = bll.GetPayInfoList();

            if (paylist.Count > 0)
            {
                ddl_PayMode1.SelectedValue = paylist[0].PayMode.ToString();
                tbx_PayAmount1.Text = paylist[0].Amount.ToString("0.##");
            }
            if (paylist.Count > 1)
            {
                ddl_PayMode2.SelectedValue = paylist[1].PayMode.ToString();
                tbx_PayAmount2.Text = paylist[1].Amount.ToString("0.##");
            }
            #endregion

            BindGrid();

            #region 界面控件可视状态
            if (bll.Model.State != 1 || bll.Model.ApproveFlag != 2)
            {
                bt_OK.Visible = false;
                tb_AddDetail.Visible = false;
                bt_Delete.Visible = false;
                tr_AddDetail.Visible = false;
                pl_detail.SetControlsEnable(false);

                gv_List.Columns[gv_List.Columns.Count - 1].Visible = false;
                gv_List.Columns[gv_List.Columns.Count - 2].Visible = false;

                ddl_PayMode1.Enabled = false;
                ddl_PayMode2.Enabled = false;
                tbx_PayAmount1.Enabled = false;
                tbx_PayAmount2.Enabled = false;
            }

            if (bll.Model.State != 1)
            {
                bt_Submit.Visible = false;
            }

            if (bll.Model.State != 2)
            {
                bt_Cancel.Visible = false;
                bt_Assign.Visible = false;
            }
            #endregion
        }
    }
Exemplo n.º 35
0
    private void BindGrid()
    {
        ListTable <PDT_ProductPrice_Detail> _details = ViewState["Details"] as ListTable <PDT_ProductPrice_Detail>;

        gv_List.BindGrid <PDT_ProductPrice_Detail>(_details.GetListItem());
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.ClientScript.RegisterClientScriptInclude("meizzDate", Page.ResolveClientUrl("~/App_Themes/basic/meizzDate.js"));
        if (!IsPostBack)
        {
            #region 获取参数
            ViewState["OrganizeCity"] = Request.QueryString["OrganizeCity"] == null ? 1 : int.Parse(Request.QueryString["OrganizeCity"]);
            ViewState["FeeType"] = Request.QueryString["FeeType"] == null ? 1 : int.Parse(Request.QueryString["FeeType"]);
            #endregion

            BindDropDown();

            #region 获取当前会计月的开始及截止日期
            int month = AC_AccountMonthBLL.GetCurrentMonth();
            AC_AccountMonth m = new AC_AccountMonthBLL(month).Model;
            BeginDate = m.BeginDate;
            EndDate = m.EndDate;
            #endregion

            #region 传递或创建空的费用明细列表
            ListTable<FNA_FeeWriteOffDetail> _details;

            if (Session["FeeWriteOffDetails"] != null)
            {
                _details = (ListTable<FNA_FeeWriteOffDetail>)Session["FeeWriteOffDetails"];
                int max = 0;
                foreach (FNA_FeeWriteOffDetail item in _details.GetListItem())
                {
                    if (item.ID > max) max = item.ID;
                }
                ViewState["MaxID"] = max;
                ViewState["Details"] = _details;
                BindGrid();
                AddEmptyDetail();
            }
            else
            {
                _details = new ListTable<FNA_FeeWriteOffDetail>(new List<FNA_FeeWriteOffDetail>(), "ID");
                ViewState["MaxID"] = 0;
                ViewState["Details"] = _details;
                AddEmptyDetail();
            }
            #endregion

            if ((int)ViewState["FeeType"] == ConfigHelper.GetConfigInt("ManagementCostType"))
            {
                tb_TeleFee.Visible = true;
                tb_MobileFee.Visible = true;

                //绑定显示报销电话费与手机费
                BindTeleList();
            }
        }
    }
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        CM_ContractBLL _bll = null;

        #region 判断合同编码是否重复
        //合同编码的获取
        TextBox tbx_ContractCode = pl_detail.FindControl("CM_Contract_ContractCode") == null ? null : (TextBox)pl_detail.FindControl("CM_Contract_ContractCode");
        if ((int)ViewState["ContractID"] == 0)
        {
            _bll = new CM_ContractBLL();

            if (tbx_ContractCode != null && tbx_ContractCode.Text != "" && CM_ContractBLL.GetModelList("ContractCode='" + tbx_ContractCode.Text.Trim() + "'").Count > 0)
            {
                MessageBox.Show(this, "对不起,合同编码" + tbx_ContractCode.Text.Trim() + "数据库已存在。");
                return;
            }
        }
        else
        {
            _bll = new CM_ContractBLL((int)ViewState["ContractID"]);
            if (tbx_ContractCode != null && tbx_ContractCode.Text != "" && CM_ContractBLL.GetModelList("ContractCode='" + tbx_ContractCode.Text.Trim() + "' AND ID !=" + _bll.Model.ID.ToString()).Count > 0)
            {
                MessageBox.Show(this, "对不起,合同编码" + tbx_ContractCode.Text.Trim() + "数据库已存在。");
                return;
            }
        }
        #endregion

        pl_detail.GetData(_bll.Model);

        ListTable <CM_ContractDetail> _details = ViewState["Details"] as ListTable <CM_ContractDetail>;
        if ((int)ViewState["ContractID"] == 0)
        {
            _bll.Model.Classify     = 21;   //租赁合同
            _bll.Model.State        = 1;
            _bll.Model.ApproveFlag  = 2;
            _bll.Model.InsertTime   = DateTime.Now;
            _bll.Model.InsertStaff  = (int)Session["UserID"];
            _bll.Model.Client       = int.Parse(ViewState["ClientID"].ToString());
            _bll.Items              = _details.GetListItem();
            ViewState["ContractID"] = _bll.Add();
        }
        else
        {
            _bll.Model.UpdateTime  = DateTime.Now;
            _bll.Model.UpdateStaff = (int)Session["UserID"];
            _bll.Update();
            #region 修改明细
            _bll.Items = _details.GetListItem(ItemState.Added);
            _bll.AddDetail();

            foreach (CM_ContractDetail _deleted in _details.GetListItem(ItemState.Deleted))
            {
                _bll.DeleteDetail(_deleted.ID);
            }

            _bll.Items = _details.GetListItem(ItemState.Modified);
            _bll.UpdateDetail();

            #endregion
        }
        if (Request.QueryString["Decision"] != "" && Request.QueryString["Decision"] == "Y")
        {
            MessageBox.Show(this, "协议编码保存成功!");
        }
        else
        {
            MessageBox.ShowAndRedirect(this, "保存物业协议详细信息成功!", "PropertyContractDetail.aspx?ContractID=" + ViewState["ContractID"].ToString());
        }
    }
        /// <summary>
        /// Afiseaza lista cu checkup-uri
        /// </summary>
        private void LoadFormCheckupuri()
        {
            try
            {
                settings = Salaries.Configuration.ModuleConfig.GetSettings();
                UtilitiesDb utilDb = new UtilitiesDb(settings.ConnectionString);
                listTable.Rows.Clear();

                //Modificat:Muntean Raluca Cristina  - am adaugat ca parametru si id-ul angajatorului
                utilDb.CreateAngajatiSelectBoxEx(this.lstResponsabil, this.GetAngajator());

                Salaries.Business.Angajat objAngajat = new Salaries.Business.Angajat();
                objAngajat.AngajatId = AngajatID;
                objAngajat.LoadAngajat();

                this.lstResponsabil.SelectedValue = "-1";
                if (objAngajat.SefId.ToString() != "-1")
                {
                    if (lstResponsabil.Items.FindByValue(this.SefID.ToString()) != null)
                    {
                        this.lstResponsabil.SelectedValue = this.SefID.ToString();
                    }
                }

                listTable.Attributes.Add("width", "100%");
                listTable.Style.Add("border", "1px solid #20b2aa");
                listTable.Attributes.Add("cellpadding", "0");
                listTable.Attributes.Add("cellspacing", "1");

                Salaries.Business.Checkupuri checkupList = new Salaries.Business.Checkupuri();
                checkupList.AngajatId = AngajatID;

                string[] arHeader = { "Necesar Instruire", "Data urmatorului", "Responsabil", "Data efectuarii", "Fisier Checkup", "Tip Fisier" };
                string[] arCols   = { "NecesarInstruire", "DataUrmatorului", "NumeIntreg", "DataEfectuarii", "CheckupFile", "CheckupID" };

                ListTable objListTable = new ListTable(listTable, checkupList.LoadCheckupuriAngajat(), arHeader, arCols);

                objListTable.textForEmptyDataSet = "Nu exista nici un checkup asociat acestui angajat!";

                string[] ar_OnClickParam     = { AngajatID.ToString(), "CheckupID", "NecesarInstruire", "DataEfectuarii", "ResponsabilID", "DataUrmatorului", "CheckupFile" };
                string[] ar_OnClickParamType = { "const", "dataset", "dataset", "dataset", "dataset", "dataset", "dataset" };

                objListTable.OnclickParams     = ar_OnClickParam;
                objListTable.OnclickParamsType = ar_OnClickParamType;
                objListTable.OnclickJSMethod   = "SelectCheckup";

                objListTable.DrawListTableWithoutDigits();

                for (int i = 1; i < listTable.Rows.Count - 1; i++)
                {
                    TableRow r = listTable.Rows[i];

                    //Daca linia nu este separator (are mai multe celule)
                    if (r.Cells.Count >= 6)
                    {
                        if (r.Cells[3].Text == "")
                        {
                            r.Cells[3].Text = "NU ESTE ANGAJAT AL FIRMEI";
                        }

                        string name     = "Checkup_" + r.Cells[6].Text + "_" + r.Cells[5].Text;
                        string FullPath = GetCheckupPath() + "//" + name;

                        if (Session["Recrutori"].ToString() == "Recrutori")
                        {
                            if (r.Cells[5].Text.Length == 0)
                            {
                                r.Cells[5].Text = " nu exista "; r.Cells[6].Text = "n/a";
                            }
                            else
                            {
                                r.Cells[6].Text = "<img src='../utils/ShowIcon.aspx?AngajatID=" + this.AngajatID + "&CheckupID=" + r.Cells[6].Text + "&file=" + r.Cells[5].Text + "'>";
                            }
                        }
                        else
                        {
                            if (r.Cells[5].Text.Length == 0)
                            {
                                r.Cells[5].Text = " nu exista "; r.Cells[6].Text = "n/a";
                            }
                            else
                            {
                                r.Cells[6].Text = "<img src='utils/ShowIcon.aspx?AngajatID=" + this.AngajatID + "&CheckupID=" + r.Cells[6].Text + "&file=" + r.Cells[5].Text + "'>";
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                litError.Text  = "The following error occurred: <br>";
                litError.Text += ex.Message;
            }
        }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            ViewState["AppID"] = Request.QueryString["AppID"] != null ? new Guid(Request.QueryString["AppID"]) : Guid.Empty;

            if ((Guid)ViewState["AppID"] == Guid.Empty)
            {
                MessageBox.ShowAndRedirect(this, "缺少必要参数!", "../Login/Index.aspx");
                return;
            }

            ViewState["PageIndex"] = 0;
            //ViewState["Sort"] = "DisplayOrder";
            //ViewState["SortDirect"] = "ASC";

            BindDropDown();

            EWF_Flow_AppBLL app = new EWF_Flow_AppBLL((Guid)ViewState["AppID"]);
            lb_AppName.Text = app.Model.Name;
            lb_AppName.NavigateUrl = "FlowAppDetail.aspx?AppID=" + ViewState["AppID"].ToString();

            ListTable<EWF_Flow_DataObject> lt = new ListTable<EWF_Flow_DataObject>(app.GetDataObjectList(), "Name");
            ViewState["ListTable"] = lt;

            BindGrid();

            #region 权限判断
            //Right right = new Right();
            //string strUserName = Session["UserName"].ToString();
            //if (!right.GetAccessPermission(strUserName, 110, 0)) Response.Redirect("../noaccessright.aspx");        //有无查看的权限
            //if (!right.GetAccessPermission(strUserName, 0, 1001)) bt_Add.Visible = false;                              //有无新增的权限
            #endregion
        }
    }
Exemplo n.º 40
0
    protected void gv_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (ViewState["Details"] == null)
        {
            return;
        }
        ListTable <PBM_DeliveryDetail> Details = (ListTable <PBM_DeliveryDetail>)ViewState["Details"];

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            int id = (int)gv_List.DataKeys[e.Row.RowIndex]["ID"];
            PBM_DeliveryDetail d = Details[id.ToString()];

            PDT_Product product = new PDT_ProductBLL(d.Product, true).Model;
            if (product == null)
            {
                return;
            }
            Dictionary <string, Dictionary_Data> dic = DictionaryBLL.GetDicCollections("PDT_Packaging");
            string _T = dic[product.TrafficPackaging.ToString()].Name;
            string _P = dic[product.Packaging.ToString()].Name;

            #region 显示产品价格包装信息
            Label lb_Price = (Label)e.Row.FindControl("lb_Price");
            if (lb_Price != null)
            {
                lb_Price.Text = (d.Price * product.ConvertFactor).ToString("0.##") + "元 / " + _T + "(" + product.ConvertFactor.ToString() + _P + ")";
            }
            #endregion

            #region 显示产品数量信息
            Label lb_Quantity = (Label)e.Row.FindControl("lb_Quantity");
            if (lb_Quantity != null)
            {
                if (d.DeliveryQuantity / product.ConvertFactor > 0)
                {
                    lb_Quantity.Text = (d.DeliveryQuantity / product.ConvertFactor).ToString() + _T;
                }

                if (d.DeliveryQuantity % product.ConvertFactor > 0)
                {
                    lb_Quantity.Text += " " + (d.DeliveryQuantity % product.ConvertFactor).ToString() + _P;
                }
            }
            #endregion

            #region 显示库存数量
            //Label lb_InventoryQuantity = (Label)e.Row.FindControl("lb_InventoryQuantity");
            //if (lb_InventoryQuantity != null && ViewState["State"] != null && (int)ViewState["State"] == 1)
            //{
            //    int inv_quantity = INV_InventoryBLL.GetProductQuantity((int)ViewState["WareHouse"], d.Product, d.LotNumber);
            //    lb_InventoryQuantity.Text = (inv_quantity / product.ConvertFactor).ToString() + _T;
            //    if (inv_quantity % product.ConvertFactor > 0)
            //        lb_InventoryQuantity.Text += " " + (inv_quantity % product.ConvertFactor).ToString() + _P;

            //    if ((int)ViewState["Classify"] == 12)
            //    {
            //        //采购退货
            //        if (d.DeliveryQuantity > inv_quantity)
            //        {
            //            lb_InventoryQuantity.Text = "<font color=red>" + lb_InventoryQuantity.Text + "【库存不足】</font>";
            //        }
            //    }
            //}
            #endregion
        }
        else if (e.Row.RowType == DataControlRowType.Footer)
        {
            e.Row.Cells[0].Text = "小计";
            e.Row.Cells[6].Text = Details.GetListItem().Sum(p => Math.Round(p.Price * p.ConvertFactor, 2) * p.DeliveryQuantity * p.DiscountRate / p.ConvertFactor).ToString("<font color=red size='larger'>0.##元</font>");
        }
    }
Exemplo n.º 41
0
    protected void bt_AddDetail_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["ID"] == 0)
        {
            return;
        }
        PBM_DeliveryBLL _bll = new PBM_DeliveryBLL((int)ViewState["ID"]);

        if (ViewState["Details"] == null)
        {
            return;
        }
        ListTable <PBM_DeliveryDetail> Details = (ListTable <PBM_DeliveryDetail>)ViewState["Details"];

        int product = 0;

        int.TryParse(select_Product.SelectValue, out product);
        //int.TryParse(RadComboBox1.SelectedValue, out product);
        if (product != 0)
        {
            PDT_ProductBLL productbll = new PDT_ProductBLL(product, true);
            if (productbll.Model == null)
            {
                return;
            }
            if (productbll.Model.ConvertFactor == 0)
            {
                productbll.Model.ConvertFactor = 1;
                productbll.Update();
            }

            string   lotnumber   = "";
            int      quantity    = 0;
            decimal  price       = 0;
            DateTime producedate = new DateTime(1900, 1, 1);


            int.TryParse(tbx_Quantity.Text, out quantity);
            decimal.TryParse(tbx_Price.Text, out price);
            DateTime.TryParse(tbx_ProductDate.Text, out producedate);
            if (producedate.Year < 1900)
            {
                producedate = new DateTime(1900, 1, 1);
            }

            if (ddl_Unit.SelectedValue == "T")
            {
                //整件单位
                quantity = quantity * productbll.Model.ConvertFactor;
                price    = price / productbll.Model.ConvertFactor;
            }

            if (quantity == 0)
            {
                //MessageBox.Show(this, "请选择采购数量!");
                return;
            }

            lotnumber = rbl_ln.SelectedValue == "N" ? tbx_LotNumber.Text : ddl_LotNumber.SelectedValue;

            if (lotnumber == "" && producedate.Year > 1900)
            {
                lotnumber = producedate.ToString("yyyyMMdd");
            }

            if ((int)ViewState["Classify"] == 12)
            {
                #region 判断库存数量是否够退货
                int inv_quantity = INV_InventoryBLL.GetProductQuantity((int)ViewState["WareHouse"], product, lotnumber);
                if (quantity > inv_quantity)
                {
                    MessageBox.Show(this, "库存不足,不可采购退货!");
                    return;
                }
                #endregion
            }
            PBM_DeliveryDetail d = null;

            if (ViewState["SelectedDetail"] != null)
            {
                d = (PBM_DeliveryDetail)ViewState["SelectedDetail"];
            }
            else
            {
                d            = new PBM_DeliveryDetail();
                d.DeliveryID = (int)ViewState["ID"];

                if (Details.GetListItem().Count == 0)
                {
                    d.ID = 1;
                }
                else
                {
                    d.ID = Details.GetListItem().Max(p => p.ID) + 1;
                }
            }

            decimal discountrate = 100;
            decimal.TryParse(tbx_DiscountRate.Text, out discountrate);

            d.Product          = product;
            d.LotNumber        = lotnumber;
            d.ProductDate      = producedate.Year < 1900 ? new DateTime(1900, 1, 1) : producedate;
            d.CostPrice        = price;
            d.Price            = d.CostPrice;
            d.DiscountRate     = discountrate / 100; //默认100为全价
            d.ConvertFactor    = productbll.Model.ConvertFactor;
            d.DeliveryQuantity = quantity;
            d.SignInQuantity   = d.DeliveryQuantity;
            d.LostQuantity     = 0;
            d.BadQuantity      = 0;
            d.SalesMode        = int.Parse(ddl_SalesMode.SelectedValue);
            if (d.SalesMode == 2)
            {
                d.Price = 0;
            }                                           //赠送模式采购价自动设为0

            if (ViewState["SelectedDetail"] != null)
            {
                Details.Update(d);
                ViewState["SelectedDetail"] = null;
                bt_AddDetail.Text           = "新 增";
                gv_List.SelectedIndex       = -1;
            }
            else
            {
                Details.Add(d);
                //_bll.AddDetail(d);
            }
            tbx_LotNumber.Text = "";
            tbx_Quantity.Text  = "0";

            BindGrid();
        }
    }
Exemplo n.º 42
0
    protected void gv_List_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
    {
        if (ViewState["Details"] == null)
        {
            return;
        }
        ListTable <PBM_DeliveryDetail> Details = (ListTable <PBM_DeliveryDetail>)ViewState["Details"];

        int id = (int)gv_List.DataKeys[e.NewSelectedIndex]["ID"];

        //PBM_DeliveryBLL _bll = new PBM_DeliveryBLL((int)ViewState["ID"]);
        //PBM_DeliveryDetail d = _bll.Items.FirstOrDefault(p => p.ID == id);

        PBM_DeliveryDetail d = Details[id.ToString()];

        PDT_Product product = new PDT_ProductBLL(d.Product, true).Model;

        if (product == null)
        {
            return;
        }

        //RadComboBox1.SelectedValue = d.Product.ToString();
        //RadComboBox1.Text = product.FullName;
        //RadComboBox1_SelectedIndexChanged(null, null);
        select_Product.SelectText  = product.FullName;
        select_Product.SelectValue = product.ID.ToString();
        select_Product_SelectChange(null, null);



        #region 显示产品包装信息
        //Dictionary<string, Dictionary_Data> dic = DictionaryBLL.GetDicCollections("PDT_Packaging");
        //lb_PackagingName_T.Text = dic[product.TrafficPackaging.ToString()].Name;
        //lb_PackagingName_P.Text = dic[product.Packaging.ToString()].Name;
        //lb_TrafficPackagingName.Text = "元/" + lb_PackagingName_T.Text + "(" + product.ConvertFactor.ToString() + lb_PackagingName_P.Text + ")";
        #endregion

        if (rbl_ln.SelectedValue == "N")
        {
            tbx_LotNumber.Text = d.LotNumber;
        }
        else if (ddl_LotNumber.Items.FindByValue(d.LotNumber) != null)
        {
            ddl_LotNumber.SelectedValue = d.LotNumber;
        }
        tbx_ProductDate.Text = d.ProductDate.ToString("yyyy-MM-dd");

        if (d.DeliveryQuantity % product.ConvertFactor == 0)
        {
            ddl_Unit.SelectedValue = "T";
            tbx_Price.Text         = (d.Price * product.ConvertFactor).ToString("0.##");
            tbx_Quantity.Text      = (d.DeliveryQuantity / product.ConvertFactor).ToString();
        }
        else
        {
            ddl_Unit.SelectedValue = "P";
            tbx_Price.Text         = d.Price.ToString("0.##");
            tbx_Quantity.Text      = d.DeliveryQuantity.ToString();
        }
        tbx_DiscountRate.Text       = (d.DiscountRate * 100).ToString("0.##");
        ddl_SalesMode.SelectedValue = d.SalesMode.ToString();
        ViewState["SelectedDetail"] = d;
        bt_AddDetail.Text           = "修 改";
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);

            BindDropDown();

            #region 创建空的列表
            ListTable<ORD_OrderDeliveryDetail> _details = new ListTable<ORD_OrderDeliveryDetail>
                (new ORD_OrderDeliveryBLL((int)ViewState["ID"]).Items, "ApplyDetailID");
            ViewState["Details"] = _details;
            #endregion

            if ((int)ViewState["ID"] == 0)
            {
                #region 新费用申请时,初始化申请信息
                pn_OrderDelivery.Visible = false;

                bt_Approve.Visible = false;
                bt_ConfirmDelivery.Visible = false;
                bt_ConfirmSignIn.Visible = false;
                bt_Delete.Visible = false;
                gv_OrderList.Columns[gv_OrderList.Columns.Count - 1].Visible = true;
                #endregion

                if (tr_OrganizeCity.SelectValue != "1")
                    BindOrderApplyCanDelivery();
            }
            else
            {
                tr_OrganizeCity.Enabled = false;
                BindData();
            }

        }
    }
Exemplo n.º 44
0
    private bool Save()
    {
        if (ViewState["Details"] == null)
        {
            return(false);
        }
        ListTable <PBM_DeliveryDetail> Details = (ListTable <PBM_DeliveryDetail>)ViewState["Details"];

        PBM_DeliveryBLL _bll;

        if ((int)ViewState["ID"] != 0)
        {
            //修改
            _bll = new PBM_DeliveryBLL((int)ViewState["ID"]);
        }
        else
        {
            //新增
            _bll = new PBM_DeliveryBLL();
        }

        pl_detail.GetData(_bll.Model);

        #region 判断必填项
        if (_bll.Model.Supplier == 0)
        {
            MessageBox.Show(this, "请正确选择供货商!");
            return(false);
        }

        if (_bll.Model.ClientWareHouse == 0)
        {
            MessageBox.Show(this, "请正确选择入库仓库!");
            return(false);
        }
        #endregion

        //折扣价
        _bll.Model.DiscountAmount = Details.GetListItem().Sum(p => (1 - p.DiscountRate) * Math.Round(p.Price * p.ConvertFactor, 2) * p.DeliveryQuantity / p.ConvertFactor);

        //实际成交价
        _bll.Model.ActAmount = Math.Round((_bll.Model.Classify == 12 ? -1 : 1) *
                                          Details.GetListItem().Sum(p => p.DiscountRate * Math.Round(p.Price * p.ConvertFactor, 2) * p.SignInQuantity / p.ConvertFactor)
                                          - _bll.Model.WipeAmount, 2);

        if ((int)ViewState["ID"] != 0)
        {
            //修改
            _bll.Model.UpdateStaff = (int)Session["UserID"];

            #region 保存明细
            if (ViewState["Details"] == null)
            {
                return(false);
            }

            foreach (PBM_DeliveryDetail d in Details.GetListItem(ItemState.Added))
            {
                _bll.AddDetail(d);
            }
            foreach (PBM_DeliveryDetail d in Details.GetListItem(ItemState.Modified))
            {
                _bll.UpdateDetail(d);
            }
            foreach (PBM_DeliveryDetail d in Details.GetListItem(ItemState.Deleted))
            {
                _bll.DeleteDetail(d.ID);
            }
            #endregion

            if (_bll.Update() == 0)
            {
                SavePayInfo();
                return(true);
            }
        }
        else
        {
            //新增
            _bll.Model.InsertStaff = (int)Session["UserID"];
            _bll.Items             = Details.GetListItem();
            ViewState["ID"]        = _bll.Add();

            if ((int)ViewState["ID"] > 0)
            {
                SavePayInfo();
                return(true);
            }
        }
        return(false);
    }
    private void BindData()
    {
        PBM_DeliveryBLL bll = new PBM_DeliveryBLL((int)ViewState["ID"]);
        if ((int)ViewState["ID"] == 0 || bll.Model == null) Response.Redirect("SaleOutList.aspx");
        if (Session["OwnerType"] != null && (int)Session["OwnerType"] == 3 && bll.Model.Supplier != (int)Session["OwnerClient"]) Response.Redirect("SaleOutList.aspx");

        ListTable<PBM_DeliveryDetail> listDelivery = new ListTable<PBM_DeliveryDetail>(bll.Items, "ID");
        ViewState["Details"] = listDelivery;

        //获取分页数量
        int totlaItem = ((ListTable<PBM_DeliveryDetail>)ViewState["Details"]).GetListItem().Count;
        int pageNum = (totlaItem / PRINTPAGESIZE) + (totlaItem % PRINTPAGESIZE == 0 ? 0 : 1);

        ViewState["TotalPageCount"] = pageNum;

        //int[] intTemp = new int[pageNum];
        //for (int i = 0; i < pageNum; i++) intTemp[i] = i;

        //Repeater1.DataSource = intTemp;
        //Repeater1.DataBind();
    }
Exemplo n.º 46
0
    private void BindData()
    {
        PBM_DeliveryBLL bll = new PBM_DeliveryBLL((int)ViewState["ID"]);

        if (bll.Model != null)
        {
            pl_detail.BindData(bll.Model);

            ViewState["Details"]   = new ListTable <PBM_DeliveryDetail>(bll.Items, "ID");
            ViewState["WareHouse"] = bll.Model.ClientWareHouse;
            ViewState["State"]     = bll.Model.State;
            ViewState["Classify"]  = bll.Model.Classify;

            if ((int)ViewState["Classify"] == 12)
            {
                //采购退货
                rbl_ln.SelectedValue = "Y";
                rbl_ln.Items.FindByValue("N").Enabled = false;
                rbl_ln.Items.Remove(rbl_ln.Items.FindByValue("N"));
                ddl_LotNumber.Visible = true;
                tbx_LotNumber.Visible = false;
            }

            #region 绑定付款信息
            IList <PBM_DeliveryPayInfo> paylist = bll.GetPayInfoList();
            if (paylist.Count == 0)
            {
                tbx_PayAmount1.Text = bll.Model.ActAmount.ToString("0.##");
            }
            else
            {
                if (paylist.Sum(p => p.Amount) != bll.Model.ActAmount)
                {
                    //收款金额与实际金额不符的,清除原收款信息
                    bll.ClearPayInfo();
                    tbx_PayAmount1.Text = bll.Model.ActAmount.ToString("0.##");
                }
                else
                {
                    if (paylist.Count > 0)
                    {
                        ddl_PayMode1.SelectedValue = paylist[0].PayMode.ToString();
                        tbx_PayAmount1.Text        = paylist[0].Amount.ToString("0.##");
                    }
                    if (paylist.Count > 1)
                    {
                        ddl_PayMode2.SelectedValue = paylist[1].PayMode.ToString();
                        tbx_PayAmount2.Text        = paylist[1].Amount.ToString("0.##");
                    }
                }
            }
            #endregion

            BindGrid();

            #region 界面控件可视状态
            if (bll.Model.State != 1 || bll.Model.ApproveFlag != 2)
            {
                bt_OK.Visible        = false;
                tb_AddDetail.Visible = false;
                tr_AddDetail.Visible = false;
                bt_Delete.Visible    = false;
                pl_detail.SetControlsEnable(false);

                gv_List.Columns[gv_List.Columns.Count - 1].Visible = false;
                gv_List.Columns[gv_List.Columns.Count - 2].Visible = false;
            }

            if (!((bll.Model.State == 1 && bll.Model.PrepareMode == 1) || (bll.Model.State == 3 && bll.Model.PrepareMode == 3)))
            {
                ddl_PayMode1.Enabled   = false;
                ddl_PayMode2.Enabled   = false;
                tbx_PayAmount1.Enabled = false;
                tbx_PayAmount2.Enabled = false;
                bt_Confirm.Visible     = false;
            }

            #endregion

            bt_Print.OnClientClick = "javascript:doprint(" + bll.Model.ID.ToString() + ");";
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 判断传入参数是否为SheetCode
            if (Request.QueryString["SheetCode"] != null)
            {
                string code = Request.QueryString["SheetCode"];

                IList<ORD_OrderApply> list = ORD_OrderApplyBLL.GetModelList("SheetCode='" + code + "'");
                if (list.Count > 0)
                {
                    Response.Redirect("OrderProductApplyDetail.aspx?ID=" + list[0].ID.ToString());
                }
                else
                    Response.Redirect("OrderApplyList.aspx");
            }
            #endregion
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);

            BindDropDown();
            ViewState["Product"] = 0;

            #region 创建空的列表
            ListTable<ORD_OrderApplyDetail> _details = new ListTable<ORD_OrderApplyDetail>(new ORD_OrderApplyBLL((int)ViewState["ID"]).Items, "Product");
            ViewState["Details"] = _details;
            #endregion

            if (Session["LogisticsOrderApplyDetail"] != null && (int)ViewState["ID"] == 0)
            {
                #region 新费用申请时,初始化申请信
                ORD_OrderCartBLL cart = (ORD_OrderCartBLL)Session["LogisticsOrderApplyDetail"];
                ORD_OrderApply model = new ORD_OrderApply();
                if (cart.Client != 0)
                {
                    model.OrganizeCity = new CM_ClientBLL(cart.Client).Model.OrganizeCity;
                    model.Client = cart.Client;
                }
                model.InsertStaff = (int)Session["UserID"];
                model.InsertTime = DateTime.Now;
                model["IsSpecial"] = cart.IsSpecial.ToString();
                model.Type = cart.Type;
                ViewState["Type"] = cart.Type;
                model["ProductBrand"] = cart.Brand.ToString();
                model["ProductType"] = cart.OrderType.ToString();
                if (cart.OrderType != 1) priceEnable = true;
                model.AccountMonth = AC_AccountMonthBLL.GetCurrentMonth();

                ORD_OrderLimitFactorBLL limitbll = new ORD_OrderLimitFactorBLL();
                ViewState["Limit"] = limitbll.GetLimitInfo(Convert.ToInt32(model.AccountMonth), cart.Client);
                bt_Submit.Visible = false;

                foreach (ORD_OrderCart item in cart.Items)
                {
                    ORD_OrderApplyDetail _detailmodel = new ORD_OrderApplyDetail();
                    _detailmodel.Price = item.Price;
                    _detailmodel.Product = item.Product;
                    _detailmodel.BookQuantity = item.BookQuantity;
                    _details.Add(_detailmodel);
                }
                ViewState["Details"] = _details;
                pn_OrderApply.BindData(model);
                BindGrid();
                #endregion
            }
            else
            {
                BindData();
            }

            Header.Attributes["WebPageSubCode"] = "Type=" + ViewState["Type"].ToString();

        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 动态加入事件
        ddl_PartyCSignMan = (DropDownList)pl_detail.FindControl("CM_Contract_PartyCSignMan");
        ddl_PartyC = (DropDownList)pl_detail.FindControl("CM_Contract_PartyC");
        if (ddl_PartyC != null)
        {
            ddl_PartyC.AutoPostBack = true;
            ddl_PartyC.SelectedIndexChanged += new EventHandler(ddl_PartyC_SelectedIndexChanged);
        }

        ddl_RebateLevel = (DropDownList)pl_detail.FindControl("CM_Contract_RebateLevel");
        if (ddl_RebateLevel != null)
        {
            ddl_RebateLevel.AutoPostBack = true;
            ddl_RebateLevel.SelectedIndexChanged += new EventHandler(ddl_RebateLevel_SelectedIndexChanged);
        }
        tbx_EndDate = pl_detail.FindControl("CM_Contract_EndDate") != null ? (TextBox)pl_detail.FindControl("CM_Contract_EndDate") : null;
        tbx_BeginDate = pl_detail.FindControl("CM_Contract_BeginDate") != null ? (TextBox)pl_detail.FindControl("CM_Contract_BeginDate") : null;

        #endregion

        if (!Page.IsPostBack)
        {
            #region 获取页面参数
            ViewState["ContractID"] = Request.QueryString["ContractID"] == null ? 0 : int.Parse(Request.QueryString["ContractID"]);
            ViewState["Classify"] = Request.QueryString["Classify"] == null ? 0 : int.Parse(Request.QueryString["Classify"]);
            ViewState["ClientID"] = 0;
            if (Request.QueryString["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Request.QueryString["ClientID"]);
                Session["ClientID"] = ViewState["ClientID"];
            }
            else if (Session["ClientID"] != null)
            {
                ViewState["ClientID"] = Int32.Parse(Session["ClientID"].ToString());
            }

            if ((int)ViewState["ContractID"] == 0 && (int)ViewState["ClientID"] == 0) Response.Redirect("~/SubModule/DeskTop.aspx");
            #endregion

            BindDropDown();

            #region 创建空的列表
            ListTable<CM_ContractDetail> _details = new ListTable<CM_ContractDetail>(new CM_ContractBLL((int)ViewState["ContractID"]).Items, "ID");
            ViewState["MAXID"] = _details.GetListItem().Count > 0 ? _details.GetListItem().Max(p => p.ID) : 0;
            ViewState["Details"] = _details;
            #endregion

            if ((int)ViewState["ContractID"] != 0)
            {
                BindData();
                DropDownList ddl_PromotorCostPayMode = (DropDownList)pl_detail.FindControl("CM_Contract_PromotorCostPayMode");
                if (ddl_PromotorCostPayMode != null)
                {
                    //月付的管理费,不需上协议
                    if (ddl_PromotorCostPayMode.Items.FindByValue("1") != null)
                        ddl_PromotorCostPayMode.Items.FindByValue("1").Enabled = false;

                    if (ddl_PromotorCostPayMode.Items.FindByValue("20") != null)
                        ddl_PromotorCostPayMode.Items.FindByValue("20").Enabled = false;
                }
            }
            else if ((int)ViewState["ClientID"] != 0)
            {
                Label l = (Label)pl_detail.FindControl("CM_Contract_Client");
                CM_Client m = new CM_ClientBLL((int)ViewState["ClientID"]).Model;
                if (l != null) l.Text = m.FullName.ToString();

                DropDownList ddl_Classify = (DropDownList)pl_detail.FindControl("CM_Contract_Classify");
                if (ddl_Classify != null) ddl_Classify.SelectedValue = ViewState["Classify"].ToString();
                BindContractClassify((int)ViewState["Classify"]);

                if (tbx_BeginDate != null && tbx_EndDate != null)
                {
                    tbx_BeginDate.Text = DateTime.Today.AddDays(1).ToString("yyyy-MM-dd");
                    tbx_EndDate.Text = DateTime.Today.AddYears(1).ToString("yyyy-MM-dd");

                    if (((int)ViewState["Classify"] == 2 || (int)ViewState["Classify"] == 3) && CM_ContractBLL.GetModelList("State=3 AND Classify=" + ViewState["Classify"].ToString() + " AND Client=" + ViewState["ClientID"].ToString()).Count > 0)
                    {
                        MessageBox.Show(this, "该协议同时只能有一条生效,请先中止生效的协议后再新增");
                    }
                    //判断是否门店关联离职导购

                }

                if (ddl_PartyCSignMan != null) ddl_PartyCSignMan.Items.Clear();

                bt_Submit.Visible = false;
                bt_Delete.Visible = false;
                bt_Approve.Visible = false;
                bt_Disable.Visible = false;
                bt_FeeApply.Visible = false;
                UploadFile1.Visible = false;
                bt_print.Visible = false;
                if ((int)ViewState["Classify"] != 1)
                {
                    tr_AddDetail.Visible = false;
                    tr_ContractDetail.Visible = false;
                }
            }

            Header.Attributes["WebPageSubCode"] = "Classify=" + ViewState["Classify"].ToString();
        }

        #region 注册弹出窗口脚本
        string script = "function PopSetEndDate(id){\r\n";
        script += "var tempid = Math.random() * 10000; \r\n window.showModalDialog('" + Page.ResolveClientUrl("Pop_SetContractEndDate.aspx") +
            "?ContractID=' + id +'&tempid='+tempid, window, 'dialogWidth:500px;DialogHeight=260px;status:yes;resizable=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Pop_SetContractEndDate", script, true);
        #endregion
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 判断传入参数是否为SheetCode
            if (Request.QueryString["SheetCode"] != null)
            {
                string code = Request.QueryString["SheetCode"];
                IList<FNA_FeeApply> list = FNA_FeeApplyBLL.GetModelList("SheetCode='" + code + "'");
                if (list.Count > 0)
                    Response.Redirect("FeeApplyDetail3.aspx?ID=" + list[0].ID.ToString());
                else
                    Response.Redirect("FeeApplyList.aspx");
            }
            #endregion

            #region 获取参数
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            ViewState["OrganizeCity"] = Request.QueryString["OrganizeCity"] == null ? 0 : int.Parse(Request.QueryString["OrganizeCity"]);
            ViewState["FeeType"] = Request.QueryString["FeeType"] == null ? 0 : int.Parse(Request.QueryString["FeeType"]);
            ViewState["AccountTitle2"] = Request.QueryString["AccountTitle2"] == null ? 0 : int.Parse(Request.QueryString["AccountTitle2"]);
            ViewState["AccountMonth"] = Request.QueryString["AccountMonth"] == null ? 0 : int.Parse(Request.QueryString["AccountMonth"]);
            ViewState["ActivityID"] = Request.QueryString["ActivityID"] == null ? 0 : int.Parse(Request.QueryString["ActivityID"]);
            ViewState["Client"] = Request.QueryString["Client"] == null ? 0 : int.Parse(Request.QueryString["Client"]);
            ViewState["Brand"] = Request.QueryString["Brand"] == null ? 0 : int.Parse(Request.QueryString["Brand"]);
            ViewState["RelateCar"] = Request.QueryString["RelateCar"] == null ? 0 : int.Parse(Request.QueryString["RelateCar"]);
            ViewState["GiftFeeClassify"] = Request.QueryString["GiftFeeClassify"] == null ? 0 : int.Parse(Request.QueryString["GiftFeeClassify"]);
            ViewState["FromGeneralFlow"] = Request.QueryString["FromGeneralFlow"] == null ? "N" : Request.QueryString["FromGeneralFlow"];

            Session["FeeApplyDetail"] = null;
            Session["SuccessFlag"] = null;
            #endregion

            BindDropDown();

            #region 创建费用明细的列表
            ListTable<FNA_FeeApplyDetail> _details = new ListTable<FNA_FeeApplyDetail>(new FNA_FeeApplyBLL((int)ViewState["ID"]).Items, "ID");
            ViewState["Details"] = _details;

            int max = 0;
            if (_details.GetListItem().Count > 0) _details.GetListItem().Max(p => p.ID);
            ViewState["MaxID"] = max;
            #endregion

            if ((int)ViewState["ID"] == 0)
            {
                if ((int)ViewState["FeeType"] == 0 || (int)ViewState["OrganizeCity"] == 0)
                {
                    Response.Redirect("FeeApplyDetail0.aspx");
                    return;
                }
                ViewState["DicFeeType"] = DictionaryBLL.GetDicCollections("FNA_FeeType")[ViewState["FeeType"].ToString()];

                if ((int)ViewState["AccountMonth"] == 0)
                    ViewState["AccountMonth"] = AC_AccountMonthBLL.GetCurrentMonth();

                #region 新费用申请时,初始化申请信息
                Label lb_OrganizeCity = (Label)pn_FeeApply.FindControl("FNA_FeeApply_OrganizeCity");
                if (lb_OrganizeCity != null) lb_OrganizeCity.Text = TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", (int)ViewState["OrganizeCity"]);

                Label lb_month = (Label)pn_FeeApply.FindControl("FNA_FeeApply_AccountMonth");
                if (lb_month != null) lb_month.Text = new AC_AccountMonthBLL((int)ViewState["AccountMonth"]).Model.Name;

                Label lb_FeeType = (Label)pn_FeeApply.FindControl("FNA_FeeApply_FeeType");
                if (lb_FeeType != null) lb_FeeType.Text = ((Dictionary_Data)ViewState["DicFeeType"]).Name;

                Label lb_staff = (Label)pn_FeeApply.FindControl("FNA_FeeApply_InsertStaff");
                if (lb_staff != null) lb_staff.Text = new Org_StaffBLL((int)Session["UserID"]).Model.RealName;

                Label lb_InsertTime = (Label)pn_FeeApply.FindControl("FNA_FeeApply_InsertTime");
                if (lb_InsertTime != null) lb_InsertTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");

                TextBox tbx_Title = (TextBox)pn_FeeApply.FindControl("FNA_FeeApply_Title");
                if (tbx_Title != null && lb_FeeType != null)
                    tbx_Title.Text = lb_month.Text + " " + lb_FeeType.Text + "申请单" + Session["UserRealName"].ToString();

                if ((int)ViewState["AccountTitle2"] != 0)
                {
                    Label lb_AccountTitle2 = (Label)pn_FeeApply.FindControl("FNA_FeeApply_AccountTitle2");
                    if (lb_AccountTitle2 != null) lb_AccountTitle2.Text = new AC_AccountTitleBLL((int)ViewState["AccountTitle2"]).Model.Name;
                }

                DropDownList ddl_Brand = (DropDownList)pn_FeeApply.FindControl("FNA_FeeApply_ProductBrand");
                if (ddl_Brand != null) ddl_Brand.SelectedValue = ViewState["Brand"].ToString();

                if ((int)ViewState["RelateCar"] != 0)
                {
                    Label lb_RelateCar = (Label)pn_FeeApply.FindControl("FNA_FeeApply_RelateCar");
                    if (lb_RelateCar != null)
                    {
                        Car_CarList car = new Car_CarListBLL((int)ViewState["RelateCar"]).Model;
                        if (car != null)
                            lb_RelateCar.Text = car.CarNo;
                        else
                            ViewState["RelateCar"] = 0;
                    }
                }
                #endregion

                if (((Dictionary_Data)ViewState["DicFeeType"]).Description == "BudgetControl")
                    BindBudgetInfo();
                else if (((Dictionary_Data)ViewState["DicFeeType"]).Description == "FeeRateControl")
                    BindFeeRateInfo();
                UploadFile1.Visible = false;
                bt_Submit.Visible = false;
                bt_ViewReport.Visible = false;
                bt_Print.Visible = false;
                bt_Copy.Visible = false;
                bt_ViewWriteOff.Visible = false;
                bt_Cancel.Visible = false;
                tbl_Remark.Visible = true;
            }
            else
            {
                BindData();
            }
            bt_AddDetail.OnClientClick =
                string.Format("PopAddFeeDetail({0},{1},{2},{3},{4},{5});",
                    ViewState["FeeType"].ToString(),
                    ViewState["OrganizeCity"].ToString(),
                    ViewState["AccountMonth"].ToString(),
                    ViewState["AccountTitle2"].ToString(),
                    ViewState["Brand"].ToString(),
                    ViewState["RelateCar"].ToString()
                    );
        }

        #region 注册弹出窗口脚本
        string script = "function PopAddFeeDetail(feetype,organizecity,month,accounttitle2,brand,car){\r\n";
        script += "var tempid = Math.random() * 10000; \r\n window.showModalDialog('" + Page.ResolveClientUrl("Pop_AddFeeApplyDetailItem.aspx") +
            "?FeeType=' + feetype + '&OrganizeCity=' + organizecity + '&AccountMonth=' + month + '&AccountTitle2=' + accounttitle2 + '&Client=" +
            ViewState["Client"].ToString() + "&Brand=' + brand + '&RelateCar=' + car + '&FromGeneralFlow=" + ViewState["FromGeneralFlow"].ToString()
            + "&tempid='+tempid, window, 'dialogWidth:800px;DialogHeight=600px;status:yes;resizable=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopAddFeeDetail", script, true);

        script = "function PopReport(id){\r\n";
        script += "var tempid = Math.random() * 10000; \r\n window.showModalDialog('" + Page.ResolveClientUrl("~/SubModule/ReportViewer/PubReportViewerFeeApp.aspx?ViewFramework=false&ReportPath=/MCS_FNA_Report/Report_FNA_ClientInfoByAppID_001&FeeAppID=' + id ") +
            ", window, 'dialogWidth:800px;DialogHeight=600px;status:yes;resizable=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopReport", script, true);

        script = "function PopWriteOffListByDetailID(detailid){\r\n";
        script += "var tempid = Math.random() * 10000; \r\n window.showModalDialog('" + Page.ResolveClientUrl("../FeeWriteoff/Pop_FeeWriteOffListByFeeApply.aspx?tempid='+tempid+'&FeeApplyDetailID=' + detailid ") +
            ", window, 'dialogWidth:800px;DialogHeight=600px;status:yes;resizable=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopWriteOffListByDetailID", script, true);

        script = "function PopWriteOffListByApplyID(applyid){\r\n";
        script += "var tempid = Math.random() * 10000; \r\n window.showModalDialog('" + Page.ResolveClientUrl("../FeeWriteoff/Pop_FeeWriteOffListByFeeApply.aspx?tempid='+tempid+'&FeeApplyID=' + applyid ") +
            ", window, 'dialogWidth:800px;DialogHeight=600px;status:yes;resizable=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopWriteOffListByApplyID", script, true);

        script = "function PopAdjust(id){\r\n";
        script += "var tempid = Math.random() * 10000; \r\n window.showModalDialog('" + Page.ResolveClientUrl("Pop_AdjustApplyDetail.aspx") +
            "?ID=' + id + '&tempid='+tempid, window, 'dialogWidth:500px;DialogHeight=600px;status:yes;resizable=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopAdjust", script, true);

        script = "function PopClientFNAInfo(clientid){\r\n";
        script += "var tempid = Math.random() * 10000; \r\n window.showModalDialog('" + Page.ResolveClientUrl("../FeeApplyOrWriteoffByClientList.aspx") +
            "?ClientID=' + clientid + '&tempid='+tempid, window, 'dialogWidth:900px;DialogHeight=600px;status:yes;resizable=yes');}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "PopClientFNAInfo", script, true);
        #endregion
    }
    private void BindData()
    {
        EWF_Flow_ProcessJointDecisionBLL bll = new EWF_Flow_ProcessJointDecisionBLL((Guid)ViewState["ProcessID"]);
        ViewState["Details"] = new ListTable<EWF_Flow_ProcessJointDecision_Recipients>(bll.Items, "RecipientRole");

        #region 绑定基本信息
        this.lb_ID.Text = ViewState["ProcessID"].ToString();
        tbx_Name.Text = bll.Model.Name;
        tbx_Description.Text = bll.Model.Description;
        ddl_DefaultNextProcess.SelectedValue = bll.Model.DefaultNextProcess.ToString();
        tbx_Sort.Text = bll.Model.Sort.ToString();
        #endregion

        tbx_TimeoutHours.Text = bll.Model.TimeoutHours.ToString();
        tbx_MessageSubject.Text = bll.Model.MessageSubject;

        ddl_NeedAllPositive.SelectedValue = bll.Model.NeedAllPositive;
        tbx_AtLeastPositiveNum.Text = bll.Model.AtLeastPositiveNum.ToString();
        ddl_NeedAllPositive_SelectedIndexChanged(null, null);

        ddl_PositiveNextProcess.SelectedValue = bll.Model.PositiveNextProcess.ToString();
        ddl_NegativeNextProcess.SelectedValue = bll.Model.NegativeNextProcess.ToString();

        BindGrid();
    }
    private void BindData()
    {
        int id = (int)ViewState["ID"];
        ORD_OrderDelivery m = new ORD_OrderDeliveryBLL(id).Model;

        if (m == null) Response.Redirect("OrderDeliveryList.aspx");

        pn_OrderDelivery.BindData(m);

        #region 根据状态控制页面显示
        if (m.State == 2 || m.State == 3)
        {
            //在途状态、部分签收
            bNoSignIn = true;
        }
        else
        {
            bt_Save.Visible = false;
        }
        #endregion
        ddl_BalanceLostCost_SelectedIndexChanged(null, null);
        #region 创建空的列表
        ListTable<ORD_OrderDeliveryDetail> _details = new ListTable<ORD_OrderDeliveryDetail>
            (new ORD_OrderDeliveryBLL((int)ViewState["ID"]).Items, "Product");
        ViewState["Details"] = _details;
        #endregion

        BindGrid();
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            #region 获取页面参数
            ViewState["ID"] = Request.QueryString["ID"] != null ? int.Parse(Request.QueryString["ID"]) : 0;
            #endregion

            BindDropDown();

            if ((int)ViewState["ID"] != 0)
            {
                //修改
                BindData();
            }
            else
            {
                //新增
                ViewState["Client"] = Request.QueryString["Client"] != null ? int.Parse(Request.QueryString["Client"]) : 0;
                ViewState["WareHouse"] = Request.QueryString["WareHouse"] != null ? int.Parse(Request.QueryString["WareHouse"]) : 0;
                ViewState["Salesman"] = Request.QueryString["Salesman"] != null ? int.Parse(Request.QueryString["Salesman"]) : 0;

                PBM_Delivery d = new PBM_Delivery();
                d.Supplier = (int)Session["OwnerClient"];
                d.SupplierWareHouse = (int)ViewState["WareHouse"];
                d.Client = (int)ViewState["Client"];
                d.SalesMan = (int)ViewState["Salesman"];
                d.Classify = 1;
                d.PrepareMode = 1;

                pl_detail.BindData(d);

                ViewState["Details"] = new ListTable<PBM_DeliveryDetail>(new List<PBM_DeliveryDetail>(), "ID");
            }

        }
    }
    private void BindData()
    {
        int id = (int)ViewState["ID"];
        ORD_OrderDelivery m = new ORD_OrderDeliveryBLL(id).Model;

        if (m == null) Response.Redirect("OrderDeliveryList.aspx");

        pn_OrderDelivery.BindData(m);

        #region 根据状态控制页面显示
        if (m.ApproveFlag == 2)
        {
            bt_ConfirmDelivery.Visible = false;
            gv_OrderList.Columns[gv_OrderList.Columns.Count - 1].Visible = false;
            gv_OrderList.Columns[gv_OrderList.Columns.Count - 2].Visible = false;
            gv_OrderList.Columns[gv_OrderList.Columns.Count - 3].Visible = false;
            gv_OrderList.Columns[gv_OrderList.Columns.Count - 4].Visible = false;
        }
        else
        {
            bt_Edit.Visible = false;
            bt_Approve.Visible = false;

        }
        if (m.State != 1) bt_ConfirmDelivery.Visible = false;
        if (m.State != 2 && m.State != 3) bt_SignIn.Visible = false;
        if (m.State != 3 && m.State != 4) pn_OrderDelivery.SetPanelVisible("Panel_LGS_OrderDeliveryDetail01_02", false);
        if (m.State != 3)
        {
            pn_OrderDelivery.SetPanelEnable("Panel_LGS_OrderDeliveryDetail01_02", false);
            bt_ConfirmSignIn.Visible = false;
        }
        #endregion

        #region 创建空的列表
        ListTable<ORD_OrderDeliveryDetail> _details = new ListTable<ORD_OrderDeliveryDetail>
            (new ORD_OrderDeliveryBLL((int)ViewState["ID"]).Items, "Product");
        ViewState["Details"] = _details;
        #endregion

        BindGrid();
    }
Exemplo n.º 54
0
    protected void bt_Save_Click(object sender, EventArgs e)
    {
        #region  效性校验
        if (tr_OrganizeCity.SelectValue == "0")
        {
            MessageBox.Show(this, "必须选择管理片区才能保存!");
            return;
        }
        #endregion

        ListTable <ORD_OrderDeliveryDetail> _details = ViewState["Details"] as ListTable <ORD_OrderDeliveryDetail>;

        if (_details.GetListItem().Count == 0)
        {
            MessageBox.Show(this, "在保存之前,发货明细不能为空!");
            return;
        }
        ORD_OrderDeliveryBLL bll;

        if ((int)ViewState["ID"] == 0)
        {
            bll = new ORD_OrderDeliveryBLL();
        }
        else
        {
            bll = new ORD_OrderDeliveryBLL((int)ViewState["ID"]);
        }

        if ((int)ViewState["ID"] == 0)
        {
            bll.Model.AccountMonth = AC_AccountMonthBLL.GetCurrentMonth();
            bll.Model.InsertStaff  = (int)Session["UserID"];
            bll.Model.OrganizeCity = int.Parse(tr_OrganizeCity.SelectValue);
            bll.Model.State        = 1;
            bll.Model.ApproveFlag  = 2;
            bll.Model.SheetCode    = ORD_OrderDeliveryBLL.GenerateSheetCode(bll.Model.OrganizeCity, bll.Model.AccountMonth);
            bll.Items = _details.GetListItem();

            ViewState["ID"] = bll.Add();
        }
        else
        {
            bll.Model.UpdateStaff = (int)Session["UserID"];

            bll.Update();

            #region 修改明细

            #region 增加发放明细时,再次判断该项费用是否超过发放数量
            bll.Items = new List <ORD_OrderDeliveryDetail>();
            foreach (ORD_OrderDeliveryDetail item in _details.GetListItem(ItemState.Added))
            {
                ORD_OrderApplyDetail apply = new ORD_OrderApplyBLL().GetDetailModel(item.ApplyDetailID);
                if (apply.BookQuantity + apply.AdjustQuantity - apply.DeliveryQuantity >= item.DeliveryQuantity)
                {
                    bll.Items.Add(item);
                }
            }
            bll.AddDetail();
            #endregion

            foreach (ORD_OrderDeliveryDetail _deleted in _details.GetListItem(ItemState.Deleted))
            {
                bll.DeleteDetail(_deleted.ID);
            }

            bll.Items = _details.GetListItem(ItemState.Modified);
            bll.UpdateDetail();

            #endregion
        }
        if (sender != null)
        {
            MessageBox.ShowAndRedirect(this, "保存成功", "OrderDeliveryDetail.aspx?ID=" + ViewState["ID"].ToString());
        }
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            #region 获取页面参数
            ViewState["AppID"] = Request.QueryString["AppID"] != null ? new Guid(Request.QueryString["AppID"]) : Guid.Empty;
            ViewState["ProcessID"] = Request.QueryString["ProcessID"] != null ? new Guid(Request.QueryString["ProcessID"]) : Guid.Empty;
            #endregion

            if ((Guid)ViewState["AppID"] == Guid.Empty)
            {
                MessageBox.ShowAndRedirect(this, "缺少必要参数!", "../Login/Index.aspx");
                return;
            }

            BindDropDown();

            if ((Guid)ViewState["ProcessID"] != Guid.Empty)
            {
                BindData();
                this.bt_Save.Text = "修改";
                this.bt_Save.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                ViewState["Details"] = new ListTable<EWF_Flow_ProcessJointDecision_Recipients>(new List<EWF_Flow_ProcessJointDecision_Recipients>(), "RecipientRole");
            }
        }
    }
Exemplo n.º 56
0
    private void BindGrid()
    {
        ListTable <EWF_Flow_ProcessJointDecision_Recipients> items = (ListTable <EWF_Flow_ProcessJointDecision_Recipients>)ViewState["Details"];

        gv_List.BindGrid <EWF_Flow_ProcessJointDecision_Recipients>(items.GetListItem());
    }
    protected void bt_AddToWriteOffList_Click(object sender, EventArgs e)
    {
        ListTable<FNA_FeeWriteOffDetail> _details = Session["FeeWriteOffDetails"] as ListTable<FNA_FeeWriteOffDetail>;
        int maxid = 0;
        if (_details != null)
            if (_details.GetListItem().Count > 0) maxid = _details.GetListItem().Max(p => p.ID);
        maxid++;

        foreach (GridViewRow row in gv_FeeAplyList.Rows)
        {
            CheckBox cb_Selected = (CheckBox)row.FindControl("cb_Selected");
            if (cb_Selected.Checked)
            {
                int applyid = (int)gv_FeeAplyList.DataKeys[row.RowIndex][0];
                int applydetialid = (int)gv_FeeAplyList.DataKeys[row.RowIndex][1];

                FNA_FeeApplyBLL applyBLL = new FNA_FeeApplyBLL(applyid);
                FNA_FeeApply apply = applyBLL.Model;
                FNA_FeeApplyDetail applydetail = applyBLL.GetDetailModel(applydetialid);

                #region 陈列、返利费用判断协议是否关联合同
                IList<CM_Contract> contractList;
                contractList = CM_ContractBLL.GetModelList(@"ContractCode!='' AND ContractCode=MCS_SYS.dbo.UF_Spilt('" + applydetail.Remark + "',':',2)");
                if (applydetail.RelateContractDetail != 0)
                {
                    int ID = 0;
                    CM_ContractDetail detail = new CM_ContractBLL().GetDetailModel(applydetail.RelateContractDetail);
                    if (detail != null)
                        ID = detail.ContractID;
                    contractList = CM_ContractBLL.GetModelList("ID=" + ID.ToString());
                }

                if (contractList.Count > 0 && contractList[0].Classify < 3 && ATMT_AttachmentBLL.GetModelList("RelateType=35 AND RelateID=" + contractList[0].ID.ToString()).Count == 0)
                {
                    MessageBox.Show(this, "陈列、返利费用操作费用核销申请时,门店协议必须上传附件,请上传后再核销!");
                    return;
                }
                #endregion

                FNA_FeeWriteOffDetail m = new FNA_FeeWriteOffDetail();
                m.ID = maxid++;
                m.ApplyDetailID = applydetialid;
                m.Client = applydetail.Client;
                m.AccountTitle = applydetail.AccountTitle;
                m.ProductBrand = apply.ProductBrand;
                m.ApplyCost = applydetail.AvailCost;
                m.BeginMonth = applydetail.BeginMonth;
                m.EndMonth = applydetail.EndMonth;
                m.BeginDate = applydetail.BeginDate;
                m.EndDate = applydetail.EndDate;
                m.WriteOffCost = applydetail.AvailCost;
                m.Remark = applydetail.Remark;
                if (applydetail["BankVoucherNo"] != "") m.Remark += ",凭证:" + applydetail["BankVoucherNo"];

                if (applydetail.Remark.IndexOf("是否CA") > 0)
                    m.Remark = applydetail.Remark.Substring(applydetail.Remark.IndexOf("是否CA") - 1);
                if (_details == null)
                    _details = new ListTable<FNA_FeeWriteOffDetail>(new List<FNA_FeeWriteOffDetail>(), "ID");
                _details.Add(m);
            }
        }

        BindGrid();
        gv_FeeAplyList.PageIndex = 0;
        BindFeeApplyNoWriteOff();
    }
Exemplo n.º 58
0
    protected void bt_Save_Click(object sender, EventArgs e)
    {
        if ((Guid)ViewState["ProcessID"] != Guid.Empty)//修改
        {
            EWF_Flow_ProcessJointDecisionBLL bll = new EWF_Flow_ProcessJointDecisionBLL((Guid)ViewState["ProcessID"]);

            bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue);
            bll.Model.Description        = tbx_Description.Text;
            bll.Model.Sort = int.Parse(tbx_Sort.Text);

            bll.Model.MessageSubject = tbx_MessageSubject.Text;
            bll.Model.Name           = tbx_Name.Text;
            if (!string.IsNullOrEmpty(tbx_TimeoutHours.Text))
            {
                bll.Model.TimeoutHours = int.Parse(tbx_TimeoutHours.Text);
            }

            bll.Model.NeedAllPositive     = ddl_NeedAllPositive.SelectedValue;
            bll.Model.AtLeastPositiveNum  = int.Parse(tbx_AtLeastPositiveNum.Text);
            bll.Model.PositiveNextProcess = new Guid(ddl_PositiveNextProcess.SelectedValue);
            bll.Model.NegativeNextProcess = new Guid(ddl_NegativeNextProcess.SelectedValue);

            bll.Update();

            #region 更新明细
            ListTable <EWF_Flow_ProcessJointDecision_Recipients> items = (ListTable <EWF_Flow_ProcessJointDecision_Recipients>)ViewState["Details"];
            foreach (EWF_Flow_ProcessJointDecision_Recipients item in items.GetListItem(ItemState.Added))
            {
                bll.AddDetail(item);
            }
            foreach (EWF_Flow_ProcessJointDecision_Recipients item in items.GetListItem(ItemState.Modified))
            {
                bll.UpdateDetail(item);
            }
            foreach (EWF_Flow_ProcessJointDecision_Recipients item in items.GetListItem(ItemState.Deleted))
            {
                bll.DeleteDetail(item.ID);
            }
            #endregion
        }
        else//新增
        {
            EWF_Flow_ProcessJointDecisionBLL bll = new EWF_Flow_ProcessJointDecisionBLL();
            bll.Model.App = (Guid)ViewState["AppID"];
            bll.Model.DefaultNextProcess = new Guid(ddl_DefaultNextProcess.SelectedValue);
            bll.Model.Description        = tbx_Description.Text;
            bll.Model.Sort = int.Parse(tbx_Sort.Text);
            bll.Model.Type = 10;

            bll.Model.MessageSubject = tbx_MessageSubject.Text;
            bll.Model.Name           = tbx_Name.Text;
            if (!string.IsNullOrEmpty(tbx_TimeoutHours.Text))
            {
                bll.Model.TimeoutHours = int.Parse(tbx_TimeoutHours.Text);
            }

            bll.Model.NeedAllPositive     = ddl_NeedAllPositive.SelectedValue;
            bll.Model.AtLeastPositiveNum  = int.Parse(tbx_AtLeastPositiveNum.Text);
            bll.Model.PositiveNextProcess = new Guid(ddl_PositiveNextProcess.SelectedValue);
            bll.Model.NegativeNextProcess = new Guid(ddl_NegativeNextProcess.SelectedValue);

            bll.Items = ((ListTable <EWF_Flow_ProcessJointDecision_Recipients>)ViewState["Details"]).GetListItem();
            bll.Add();
        }
        Response.Redirect("FlowProcessList.aspx?AppID=" + ViewState["AppID"].ToString());
    }
    private void BindData()
    {
        PBM_DeliveryBLL bll = new PBM_DeliveryBLL((int)ViewState["ID"]);
        if (bll.Model != null)
        {
            pl_detail.BindData(bll.Model);

            ViewState["Client"] = bll.Model.Client;
            ViewState["Supplier"] = bll.Model.Supplier;
            ViewState["Details"] = new ListTable<PBM_DeliveryDetail>(bll.Items, "ID");
            ViewState["WareHouse"] = bll.Model.SupplierWareHouse;
            ViewState["State"] = bll.Model.State;
            ViewState["Classify"] = bll.Model.Classify;
            BindGrid();

            #region 界面控件可视状态
            if (bll.Model.State != 1 || bll.Model.ApproveFlag != 2)
            {
                bt_OK.Visible = false;
                tb_AddDetail.Visible = false;
                bt_Delete.Visible = false;
                pl_detail.SetControlsEnable(false);
                tr_AddDetail.Visible = false;

                gv_List.Columns[gv_List.Columns.Count - 1].Visible = false;
                gv_List.Columns[gv_List.Columns.Count - 2].Visible = false;
            }

            if (!((bll.Model.State == 1 && bll.Model.PrepareMode == 1) || (bll.Model.State == 3 && bll.Model.PrepareMode == 3)))
            {
                bt_Confirm.Visible = false;
            }
            #endregion

            bt_Print.OnClientClick = "javascript:doprint(" + bll.Model.ID.ToString() + ");";

        }
    }
Exemplo n.º 60
0
        /// <summary>
        /// Listarea evaluarilor psihologice
        /// </summary>
        private void LoadFormEvaluariPsihologice()
        {
            try
            {
                Salaries.Business.AdminTipuriRapoarte tipuriRapoarte = new Salaries.Business.AdminTipuriRapoarte();

                lstTipRaportID.Items.Clear();
                lstTipRaportID.DataSource     = tipuriRapoarte.LoadInfoTipuriRapoarte();
                lstTipRaportID.DataTextField  = "Denumire";
                lstTipRaportID.DataValueField = "TipRaportID";
                lstTipRaportID.DataBind();

                listTable.Rows.Clear();
                listTable.Attributes.Add("width", "100%");
                listTable.Style.Add("border", "1px solid #20b2aa");
                listTable.Attributes.Add("cellpadding", "0");
                listTable.Attributes.Add("cellspacing", "1");

                Salaries.Business.EvaluariPsihologice evaluarePsihologicaList = new Salaries.Business.EvaluariPsihologice();
                evaluarePsihologicaList.AngajatId = AngajatID;

                string[] arHeader = { "Data efectuarii", "Tip Raport", "Fisier Evaluare", "Tip Fisier" };
                string[] arCols   = { "Data", "DenumireTipRaport", "Raport", "EvalPsihologicaID" };

                ListTable objListTable = new ListTable(listTable, evaluarePsihologicaList.LoadEvaluariPsihologiceAngajat(), arHeader, arCols);

                objListTable.textForEmptyDataSet = "Nu exista nici o evaluare psihologica asociata acestui angajat!";

                string[] ar_OnClickParam     = { AngajatID.ToString(), "EvalPsihologicaID", "Data", "TipRaportID", "Raport" };
                string[] ar_OnClickParamType = { "const", "dataset", "dataset", "dataset", "dataset" };

                objListTable.OnclickParams     = ar_OnClickParam;
                objListTable.OnclickParamsType = ar_OnClickParamType;
                objListTable.OnclickJSMethod   = "SelectEvaluarePsihologica";

                objListTable.DrawListTableWithoutDigits();

                for (int i = 1; i < listTable.Rows.Count - 1; i++)
                {
                    TableRow r = listTable.Rows[i];
                    if (r.Cells.Count >= 5)
                    {
                        string name     = "EvaluarePsihologica_" + r.Cells[4].Text + "_" + r.Cells[3].Text;
                        string FullPath = GetEvaluarePsihologicaPath() + "//" + name;

                        if (Session["Recrutori"].ToString() == "Recrutori")
                        {
                            if (r.Cells[3].Text.Length == 0)
                            {
                                r.Cells[3].Text = " nu exista "; r.Cells[4].Text = "n/a";
                            }
                            else
                            {
                                r.Cells[4].Text = "<img src='../utils/ShowIcon.aspx?AngajatID=" + this.AngajatID + "&EvaluarePsihologicaID=" + r.Cells[4].Text + "&file=" + r.Cells[3].Text + "'>";
                            }
                        }
                        else
                        {
                            if (r.Cells[3].Text.Length == 0)
                            {
                                r.Cells[3].Text = " nu exista "; r.Cells[4].Text = "n/a";
                            }
                            else
                            {
                                r.Cells[4].Text = "<img src='utils/ShowIcon.aspx?AngajatID=" + this.AngajatID + "&EvaluarePsihologicaID=" + r.Cells[4].Text + "&file=" + r.Cells[3].Text + "'>";
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                litError.Text  = "The following error occurred: <br>";
                litError.Text += ex.Message;
            }
        }