Exemple #1
0
 protected void BindCountryList()
 {
     Country.DataSource     = StorageInBrowseBLL.BindCountryList();
     Country.DataTextField  = "Name";
     Country.DataValueField = "CountryCode";
     Country.DataBind();
 }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        gvProduct.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");


        if (Request.QueryString["ID"] == null)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert("入库单号不存在!"));
            Response.End();
        }

        if (!IsPostBack)
        {
            DataTable dt = StorageInBrowseBLL.getStoageInDetails(Convert.ToString(Request.QueryString["ID"]));
            ViewState["dt"]           = dt;
            this.gvProduct.DataSource = dt;
            this.gvProduct.DataBind();


            DataTable dts = StorageInBrowseBLL.getStoageIn(Request.QueryString["ID"]);

            this.gvInfo.DataSource = dts;
            this.gvInfo.DataBind();
        }
        Translations_More();
    }
Exemple #3
0
    public string getCurrencyName(string productid)
    {
        string CurrencyName = "";

        if (productid != "" && productid != null)
        {
            CurrencyName = Convert.ToString(StorageInBrowseBLL.GetCurrencyName(productid));
        }
        return(CurrencyName);
    }
Exemple #4
0
    /// <summary>
    /// 首次加载
    /// </summary>
    public void FirstLoad()
    {
        StringBuilder sb         = new StringBuilder();
        string        Currency   = StorageInBrowseBLL.GetMoreCurrencyIDByCountryCode(Country.SelectedValue).ToString();
        int           intDocType = QueryInStorageBLL.GetDocTypeIDByDocTypeName("RK");


        sb.Append(" D.DocTypeID=" + intDocType);
        sb.Append(" And " + this.Flag.SelectedValue.ToString() + " and d.Provider=p.ID ");

        string columns = "d.*,p.[Name]";
        string table   = "InventoryDoc As D,ProviderInfo as p";
        string key     = "D.ID";

        ViewState["SQLSTR"] = "select " + columns + " from " + table + " where " + sb.ToString() + " order by " + key + " desc";

        Pager pSorting = Page.FindControl("Pager1") as Pager;

        pSorting.PageBind(0, 10, table, columns, sb.ToString(), key, "gvInfo");
    }
Exemple #5
0
    public string GetCurrencyName(string Currency)
    {
        string CurrencyName = StorageInBrowseBLL.GetCurrencyNameByID(Currency);

        return(CurrencyName);
    }
Exemple #6
0
    public static string GetDepotSeatName(string DepotSeatID)
    {
        string DepotSeatName = StorageInBrowseBLL.GetDepotSeatName(DepotSeatID);

        return(DepotSeatName);
    }
Exemple #7
0
    protected string GetWarehouseName(string WareHouseId)
    {
        string WarehouseName = StorageInBrowseBLL.GetWarehouseName(WareHouseId);

        return(WarehouseName);
    }
Exemple #8
0
    protected void gvInfo_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string[] Arg     = Convert.ToString(e.CommandArgument).Split('_');
        string   DocID   = Arg[0];
        int      isExist = StorageInBrowseBLL.DocIdIsExistByDocId(DocID);

        //Exist
        if (isExist > 0)
        {
            if (e.CommandName == "Auditing")
            {
                int isAuditing = StorageInBrowseBLL.IsAuditingByDocId(DocID, 1);
                //Effective(In other words,Auditing)
                if (isAuditing > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006888", "该入库单已经被审核!")));
                }
                //No Auditing
                else
                {
                    string   DocAuditer   = CommonDataBLL.GetNameByAdminID(Session["Company"].ToString());
                    DateTime DocAuditTime = MYDateTime1.GetCurrentDateTime();
                    string   OperateIP    = CommonDataBLL.OperateIP;
                    string   OperateNum   = CommonDataBLL.OperateBh;

                    //更新公司库存
                    string TempWareHouseID = Arg[1];
                    int    changwei        = Convert.ToInt32(Arg[2]);
                    int    auditingCout    = StorageInBrowseBLL.checkDoc(DocAuditer, DocAuditTime, OperateIP, OperateNum, DocID, TempWareHouseID, changwei);
                    if (auditingCout > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>if(confirm('" + GetTran("002214", "入库单审核成功,是否要打印此入库单?") + "'))window.open('docPrint.aspx?DocID=" + DocID + "');</script>");
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002216", "入库单审核失败,请联系管理员!")));
                        return;
                    }
                }
            }
            else if (e.CommandName == "NoEffect")
            {
                int isEffect = StorageInBrowseBLL.IsAuditingByDocId(DocID, 0);
                //No effect
                if (isEffect <= 0)
                {
                    DateTime CloseDate     = MYDateTime1.GetCurrentDateTime();
                    string   OperateIP     = CommonDataBLL.OperateIP;
                    string   OperateNum    = CommonDataBLL.OperateBh;
                    int      noEffectCount = StorageInBrowseBLL.updDocTypeName(CloseDate, DocID, OperateIP, OperateNum);
                    if (noEffectCount > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002218", "此入库单审核无效成功!")));
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002221", "此入库单审核无效失败,请联系管理员!")));
                    }
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006890", "该入库单已经被审核无效!")));
                }
            }
            else if (e.CommandName == "Del")
            {
                ChangeLogs cl = new ChangeLogs("InventoryDoc", "DocID");
                cl.AddRecord(DocID);
                ChangeLogs cl2 = new ChangeLogs("InventoryDocDetails", "DocID");
                cl2.AddRecord(DocID);
                int delCount = StorageInBrowseBLL.delDoc(DocID);
                if (delCount > 0)
                {
                    cl.AddRecord(DocID);
                    cl.DeletedIntoLogs(ChangeCategory.company8, Session["Company"].ToString(), ENUM_USERTYPE.objecttype0);
                    cl2.AddRecord(DocID);
                    cl2.DeletedIntoLogs(ChangeCategory.company8, Session["Company"].ToString(), ENUM_USERTYPE.objecttype0);

                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002225", "入库单删除成功!")));
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002228", "入库单编辑失败,请联系管理员!")));
                    return;
                }
            }
            else if (e.CommandName == "Edit")
            {
                Response.Redirect("StorageInEdit.aspx?billID=" + DocID);
            }
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006894", "该入库单不存在!")));
        }
        Btn_Search_Click(null, null);
    }
Exemple #9
0
    public void getDocDetiles()
    {
        StringBuilder sb         = new StringBuilder();
        string        Currency   = StorageInBrowseBLL.GetMoreCurrencyIDByCountryCode(Country.SelectedValue).ToString();
        int           intDocType = QueryInStorageBLL.GetDocTypeIDByDocTypeName("RK");

        sb.Append(" D.DocTypeID=" + intDocType);


        if (ddlCondition.SelectedValue == "ExpectNum")
        {
            if (txtCondition.Text.Trim() != "")
            {
                int expectNum = 0;
                try
                {
                    expectNum = Convert.ToInt32(txtCondition.Text.Trim());
                }

                catch
                {
                    this.msg = Transforms.ReturnAlert(GetTran("006829", "期数输入错误!"));
                    return;
                }
                sb.Append(" and D." + ddlCondition.SelectedValue + "=" + expectNum.ToString());
            }
        }

        if (ddlCondition.SelectedIndex > 0 && ddlCondition.SelectedIndex <= 3)
        {
            if (txtCondition.Text.Trim() != "")
            {
                sb.Append(" and D." + ddlCondition.SelectedValue + " like '%" + txtCondition.Text.Trim() + "%'");
            }
        }

        if (ddlCondition.SelectedValue == "TotalMoney")
        {
            if (txtCondition.Text.Trim() != "")
            {
                try
                {
                    Convert.ToDouble(txtCondition.Text.Trim());
                }

                catch
                {
                    this.msg = Transforms.ReturnAlert(GetTran("002211", "输入错误!"));
                    return;
                }
                sb.Append(" and D." + ddlCondition.SelectedValue + " " + DropDownList1.SelectedValue + " " + Convert.ToDouble(txtCondition.Text.Trim().Replace("'", "")));
            }
        }

        if (ddlCondition.SelectedValue == "DocMakeTime")
        {
            if (txtCondition.Text.Trim() != "")
            {
                try
                {
                    Convert.ToDateTime(this.TextBox1.Text.Trim().Replace("'", ""));
                }

                catch
                {
                    this.msg = Transforms.ReturnAlert(GetTran("002211", "输入错误!"));
                    return;
                }
                sb.Append(" and DATEADD(day, DATEDIFF(day,0,D." + ddlCondition.SelectedValue + "), 0)" + DropDownList1.SelectedValue + " ' " + this.TextBox1.Text.Trim() + "'");
            }
        }

        sb.Append(" And " + Flag.SelectedValue.ToString() + " and d.Provider=p.ID ");

        string columns = "d.*,p.[Name]";
        string table   = "InventoryDoc As D,ProviderInfo as p";
        string key     = "D.ID";

        ViewState["SQLSTR"] = "select " + columns + " from " + table + " where " + sb.ToString() + " order by " + key + " desc";

        Pager pSorting = Page.FindControl("Pager1") as Pager;

        pSorting.PageBind(0, 10, table, columns, sb.ToString(), key, "gvInfo");
    }
Exemple #10
0
    public string getCurrencyName(string productid)
    {
        string CurrencyName = StorageInBrowseBLL.GetCurrencyName(productid);

        return(CurrencyName);
    }
Exemple #11
0
    protected void gvInfo_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string DocID   = Convert.ToString(e.CommandArgument);
        int    isExist = StorageInBrowseBLL.DocIdIsExistByDocId(DocID);

        //Exist
        if (isExist > 0)
        {
            if (e.CommandName == "Auditing")
            {
                int isAuditing = StorageInBrowseBLL.IsAuditingByDocId(DocID, 1);
                //Effective(In other words,Auditing)
                if (isAuditing > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006888", "该入库单已经被审核!")));
                }

                //No Auditing
                else
                {
                    string   DocAuditer   = CommonDataBLL.GetNameByAdminID(Session["Company"].ToString());
                    DateTime DocAuditTime = MYDateTime1.GetCurrentDateTime();
                    string   OperateIP    = CommonDataBLL.OperateIP;
                    string   OperateNum   = CommonDataBLL.OperateBh;

                    //更新公司库存
                    GridViewRow row             = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
                    string      TempWareHouseID = ((HtmlInputHidden)row.FindControl("hidwarehouseId")).Value;
                    string      aaa             = ((HtmlInputHidden)row.FindControl("changwei")).Value;
                    int         changwei        = Convert.ToInt32(aaa);
                    int         auditingCout    = StorageInBrowseBLL.checkDoc(DocAuditer, DocAuditTime, OperateIP, OperateNum, DocID, TempWareHouseID, changwei);
                    if (auditingCout > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>if(confirm('" + GetTran("002214", "入库单审核成功,是否要打印此入库单?") + "'))window.open('docPrint.aspx?DocID=" + DocID + "');</script>");
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002216", "入库单审核失败,请联系管理员!")));
                        return;
                    }
                }
            }

            else if (e.CommandName == "NoEffect")
            {
                int isEffect = StorageInBrowseBLL.IsAuditingByDocId(DocID, 0);
                //No effect
                if (isEffect <= 0)
                {
                    DateTime CloseDate     = MYDateTime1.GetCurrentDateTime();
                    string   OperateIP     = CommonDataBLL.OperateIP;
                    string   OperateNum    = CommonDataBLL.OperateBh;
                    int      noEffectCount = StorageInBrowseBLL.updDocTypeName(CloseDate, DocID, OperateIP, OperateNum);
                    if (noEffectCount > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002218", "此入库单审核无效成功!")));
                    }

                    else
                    {
                        Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002221", "此入库单审核无效失败,请联系管理员!")));
                    }
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006890", "该入库单已经被审核无效!")));
                }
            }

            else if (e.CommandName == "Del")
            {
                int delCount = StorageInBrowseBLL.delDoc(DocID);
                if (delCount > 0)
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002225", "入库单删除成功!")));
                }

                else
                {
                    Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002228", "入库单编辑失败,请联系管理员!")));
                    return;
                }
            }

            else if (e.CommandName == "Edit")
            {
                Response.Redirect("StorageInEdit.aspx?billID=" + DocID);
            }
        }

        else
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("006894", "该入库单不存在!")));
        }
        Response.Redirect("StorageInBrowse.aspx");
    }