コード例 #1
0
        public int Update(SqlTransaction trans, AllocationModel model)
        {
            int num = 0;

            if (model.Acode != "")
            {
                num = AllocationAction.Update(trans, model);
            }
            return(num);
        }
コード例 #2
0
        public int Delete(SqlTransaction trans, string acode)
        {
            int num = 0;

            if (acode != "")
            {
                num = AllocationAction.Delete(trans, acode);
            }
            return(num);
        }
コード例 #3
0
        public DataTable GetMaterialOfDepositoryList(string depositoryId, string strWhere)
        {
            DataTable materialOfDepositoryList = new DataTable();

            if (depositoryId != "")
            {
                materialOfDepositoryList = AllocationAction.GetMaterialOfDepositoryList(depositoryId, strWhere);
            }
            return(materialOfDepositoryList);
        }
コード例 #4
0
        public int Update(AllocationStockModel stockModel)
        {
            int num = 0;

            if (stockModel.Asid != "")
            {
                num = AllocationAction.Update(stockModel);
            }
            return(num);
        }
コード例 #5
0
        public DataTable GetTreasuryNameByCode(string code)
        {
            DataTable treasuryNameByCode = new DataTable();

            if (code != "")
            {
                treasuryNameByCode = AllocationAction.GetTreasuryNameByCode(code);
            }
            return(treasuryNameByCode);
        }
コード例 #6
0
        public int Insert(SqlTransaction trans, AllocationStockModel stockModel)
        {
            int num = 0;

            if ((stockModel.ACode != "") && (stockModel.SCode != ""))
            {
                num = AllocationAction.Insert(trans, stockModel);
            }
            return(num);
        }
コード例 #7
0
    protected void btnAllDel_ServerClick(object sender, EventArgs e)
    {
        AllocationAction.DelAllocationStockBill(this.lblAllocationNo.Text);
        DataTable dataTable = this.ViewState["DataTable"] as DataTable;

        dataTable.Rows.Clear();
        this.ViewState["DataTable"]    = dataTable;
        this.GVMaterialList.DataSource = null;
        this.GVMaterialList.DataBind();
    }
コード例 #8
0
        public int DelAllocationStock(string acode)
        {
            int num = 0;

            if (acode != "")
            {
                num = AllocationAction.DelAllocationStock(acode);
            }
            return(num);
        }
コード例 #9
0
 public Cats.Models.ProjectCodeAllocation convertToEntityModel(AllocationAction allocationAction)
 {
     return(new Cats.Models.ProjectCodeAllocation
     {
         SINumberID = allocationAction.ShippingInstructionId,
         Amount_FromSI = (int)allocationAction.AllocatedAmount,
         ProjectCodeAllocationID = allocationAction.AllocationId,
         AlloccationDate = DateTime.Now,
         AllocatedBy = 1,
         HubAllocationID = allocationAction.HubAllocationID
     });
 }
コード例 #10
0
        public int ExistSameData(string acode, string scode, string corp, decimal price)
        {
            int num = 0;

            if ((acode != "") && (corp != ""))
            {
                object obj2 = AllocationAction.ExistData(acode, scode, corp, price);
                if (obj2 != null)
                {
                    num = int.Parse(obj2.ToString());
                }
            }
            return(num);
        }
コード例 #11
0
        public DataTable GetTreasuryList(int tflag)
        {
            DataTable table = new DataTable();

            if (!(tflag.ToString() != ""))
            {
                return(table);
            }
            if (tflag != -1)
            {
                return(AllocationAction.GetTreasuryList(tflag.ToString()));
            }
            return(AllocationAction.GetTreasuryList(null));
        }
コード例 #12
0
        public string GetUserNameByCode(string code)
        {
            object userNameByCode = null;

            if (code != "")
            {
                userNameByCode = AllocationAction.GetUserNameByCode(code);
            }
            if (userNameByCode != null)
            {
                return(userNameByCode.ToString());
            }
            return("");
        }
コード例 #13
0
    protected void btnBind_ServerClick(object sender, EventArgs e)
    {
        this.UpdateDataSource();
        DataTable  dataTable = this.ViewState["DataTable"] as DataTable;
        DataTable  materialOfDepositoryList = AllocationAction.GetMaterialOfDepositoryList(this.HdnSelectOutDepo.Value, this.HdnViewCodeList.Value);
        DataColumn dataColumn = new DataColumn("Total", typeof(decimal));

        dataColumn.DefaultValue = 0m;
        materialOfDepositoryList.Columns.Add(dataColumn);
        if (dataTable != null && materialOfDepositoryList != null)
        {
            if (dataTable.Rows.Count == 1 && string.IsNullOrEmpty(dataTable.Rows[0]["scode"].ToString()))
            {
                dataTable.Rows.RemoveAt(0);
            }
            dataTable.PrimaryKey = new DataColumn[]
            {
                dataTable.Columns["scode"],
                dataTable.Columns["sprice"],
                dataTable.Columns["corp"]
            };
            materialOfDepositoryList.PrimaryKey = new DataColumn[]
            {
                materialOfDepositoryList.Columns["scode"],
                materialOfDepositoryList.Columns["sprice"],
                materialOfDepositoryList.Columns["corp"]
            };
            dataTable.Merge(materialOfDepositoryList, true);
            this.ViewState["DataTable"] = dataTable;
        }
        if (dataTable.Rows.Count > 0)
        {
            this.GVMaterialList.DataSource = dataTable;
            this.GVMaterialList.DataBind();
            string total = Convert.ToDecimal(dataTable.Compute("SUM(Total)", string.Empty)).ToString("0.000");
            GridViewUtility.AddTotalRow(this.GVMaterialList, total, 12);
            return;
        }
        this.GVMaterialList.DataSource = dataTable;
        this.GVMaterialList.DataBind();
    }
コード例 #14
0
        public int InDepositoryConfirm(string acode, string yhdm)
        {
            DataTable         table = AllocationAction.GetAllocation_StockList("sma.acode='" + acode + "' and flowstate=1 and isouta=1 ");
            int               num   = 0;
            TreasuryPermitBll bll   = new TreasuryPermitBll();
            AllocationModel   model = new AllocationModel();

            model = this.ReturnAllocatonModel(" acode='" + acode + "' ");
            if (!bll.IsPermitAccept(model.Acode, yhdm))
            {
                return(0);
            }
            if (table.Rows.Count > 0)
            {
                TreasuryStock      stock  = new TreasuryStock();
                TreasuryStockModel model2 = new TreasuryStockModel();
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    model2.corp    = table.Rows[i]["corp"].ToString();
                    model2.incode  = acode;
                    model2.intime  = DateTime.Now;
                    model2.intype  = 0;
                    model2.Type    = "A";
                    model2.isfirst = false;
                    model2.scode   = table.Rows[i]["scode"].ToString();
                    model2.snumber = decimal.Parse(table.Rows[i]["number"].ToString());
                    model2.sprice  = decimal.Parse(table.Rows[i]["sprice"].ToString());
                    model2.tcode   = table.Rows[i]["tcodeb"].ToString();
                    model2.tsid    = Guid.NewGuid().ToString();
                    if (stock.Add(model2) <= 0)
                    {
                        return(-1);
                    }
                    AllocationAction.UpdateState(true, true, acode, "In");
                    num = 1;
                }
            }
            return(num);
        }
コード例 #15
0
        public AllocationModel ReturnAllocatonModel(string strWhere)
        {
            AllocationModel model          = new AllocationModel();
            DataTable       allocationList = new DataTable();

            allocationList = AllocationAction.GetAllocationList(strWhere);
            if (allocationList.Rows.Count > 0)
            {
                model.Aid                 = allocationList.Rows[0]["aid"].ToString();
                model.Acode               = allocationList.Rows[0]["acode"].ToString();
                model.TCodea              = allocationList.Rows[0]["tcodea"].ToString();
                model.TCodeb              = allocationList.Rows[0]["tcodeb"].ToString();
                model.IsOutA              = Convert.ToBoolean(allocationList.Rows[0]["isouta"].ToString());
                model.IsInB               = Convert.ToBoolean(allocationList.Rows[0]["isinb"].ToString());
                model.Person              = allocationList.Rows[0]["person"].ToString();
                model.InTime              = allocationList.Rows[0]["intime"].ToString();
                model.Explain             = allocationList.Rows[0]["explain"].ToString();
                model.OutAllocationPerson = allocationList.Rows[0]["OutAllocationPerson"].ToString();
                model.InAllocationPerson  = allocationList.Rows[0]["InAllocationPerson"].ToString();
            }
            return(model);
        }
コード例 #16
0
ファイル: Allocation.aspx.cs プロジェクト: zxl881203/src
 protected DataTable ReportAlocationDataSource(string strWhere)
 {
     return(AllocationAction.AllocationReportData(strWhere));
 }
コード例 #17
0
        public int OutDepositoryConfirm(string acode, string yhdm)
        {
            DataTable         table = AllocationAction.GetAllocation_StockList("sma.acode='" + acode + "' and flowstate=1 ");
            DataTable         materialDetailsOfDeposity = new DataTable();
            int               num  = 0;
            decimal           num2 = 0M;
            TreasuryPermitBll bll  = new TreasuryPermitBll();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                decimal num4 = 0M;
                bool    flag = bll.IsPermitBool(table.Rows[i]["tcodea"].ToString(), yhdm);
                object  materialNumberOfDepository = AllocationAction.GetMaterialNumberOfDepository(table.Rows[i]["tcodea"].ToString(), " scode='" + table.Rows[i]["scode"].ToString() + "' and sprice='" + table.Rows[i]["sprice"].ToString() + "' and corp='" + table.Rows[i]["corp"].ToString() + "' ");
                if (!flag)
                {
                    num = -3;
                    break;
                }
                if (materialNumberOfDepository != null)
                {
                    num4 = decimal.Parse(materialNumberOfDepository.ToString());
                }
                num2 = decimal.Parse(table.Rows[i]["number"].ToString());
                if (num4 < num2)
                {
                    num = -2;
                    break;
                }
            }
            switch (num)
            {
            case -2:
            case -3:
                return(num);

            default:
                for (int j = 0; j < table.Rows.Count; j++)
                {
                    decimal num6 = 0M;
                    num6 = decimal.Parse(table.Rows[j]["number"].ToString());
                    materialDetailsOfDeposity = AllocationAction.GetMaterialDetailsOfDeposity("tcode='" + table.Rows[j]["tcodea"].ToString() + "' and scode='" + table.Rows[j]["scode"].ToString() + "' and sprice='" + table.Rows[j]["sprice"].ToString() + "' and corp='" + table.Rows[j]["corp"].ToString() + "' order by intime asc ");
                    for (int k = 0; k < materialDetailsOfDeposity.Rows.Count; k++)
                    {
                        decimal num8 = 0M;
                        num8 = decimal.Parse(materialDetailsOfDeposity.Rows[k]["snumber"].ToString());
                        if (num8 > num6)
                        {
                            if (AllocationAction.UpdateNumberOfTreasury(materialDetailsOfDeposity.Rows[k]["tsid"].ToString(), num8 - num6) <= 0)
                            {
                                num = -1;
                            }
                            else
                            {
                                Common2.AlarmMethod(table.Rows[j]["tcodea"].ToString(), table.Rows[j]["scode"].ToString());
                            }
                            break;
                        }
                        if (num8 == num6)
                        {
                            if (new TreasuryStock().Delete(materialDetailsOfDeposity.Rows[k]["tsid"].ToString()) <= 0)
                            {
                                num = -1;
                            }
                            else
                            {
                                Common2.AlarmMethod(table.Rows[j]["tcodea"].ToString(), table.Rows[j]["scode"].ToString());
                            }
                            break;
                        }
                        if (num8 < num6)
                        {
                            if (new TreasuryStock().Delete(materialDetailsOfDeposity.Rows[k]["tsid"].ToString()) <= 0)
                            {
                                num = -1;
                                break;
                            }
                            num6 -= num8;
                            Common2.AlarmMethod(table.Rows[j]["tcodea"].ToString(), table.Rows[j]["scode"].ToString());
                        }
                    }
                    if (num == -1)
                    {
                        break;
                    }
                    num = 1;
                }
                break;
            }
            if (num == 1)
            {
                AllocationAction.UpdateState(true, false, acode, "Out");
            }
            return(num);
        }
コード例 #18
0
 public DataTable GetAllocationStockList(string depositoryId, string strWhere)
 {
     return(AllocationAction.GetAllocationStockList(depositoryId, strWhere));
 }
コード例 #19
0
 public DataTable GetAllocationList(string strWhere)
 {
     return(AllocationAction.GetAllocationList(strWhere));
 }