Ejemplo n.º 1
0
        public DataTable GetDataSFTTRANSORDER(DataTable ERPPQC, DataTable TRANSORDERLINE)
        {
            DataTable dt = new DataTable();

            try
            {
                Database.SFT.SFT_TRANSORDER sFT_TRANSORDER = new Database.SFT.SFT_TRANSORDER();
                dt = sFT_TRANSORDER.GetTop1DataTable();
                Database.GetListWarehouse      getListWarehouse = new Database.GetListWarehouse();
                List <Database.WarehouseItems> listWarehouse    = getListWarehouse.GetWarehouseOnly();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["CREATER"]         = Class.valiballecommon.GetStorage().UserName;
                    dt.Rows[i]["CREATE_DATE"]     = DateTime.Now;
                    dt.Rows[i]["MODI_DATE"]       = DBNull.Value;
                    dt.Rows[i]["FLAG"]            = 0;
                    dt.Rows[i]["TRANSTYPE"]       = TRANSORDERLINE.Rows[0]["TRANSORDERTYPE"];
                    dt.Rows[i]["TRANSNO"]         = TRANSORDERLINE.Rows[0]["TRANSNO"];
                    dt.Rows[i]["TRANSDATE"]       = DateTime.Now.ToString("yyyyMMdd");
                    dt.Rows[i]["OUTTYPE"]         = "1";
                    dt.Rows[i]["OUTDEPID"]        = TRANSORDERLINE.Rows[0]["OUTDEP"];
                    dt.Rows[i]["OUTDEPNAME"]      = "胶管OEM生产线ONGOEM";
                    dt.Rows[i]["INTYPE"]          = "3";
                    dt.Rows[i]["INDEPID"]         = TRANSORDERLINE.Rows[0]["INDEP"];
                    dt.Rows[i]["INDEPNAME"]       = listWarehouse.Where(d => d.MC001_Wh.Contains(TRANSORDERLINE.Rows[0]["INDEP"].ToString())).Select(d => d.MC002_WhName).ToList()[0];
                    dt.Rows[i]["FACTORYID"]       = TRANSORDERLINE.Rows[0]["FACTORYID"];
                    dt.Rows[i]["CONFIRMCODE"]     = "Y";
                    dt.Rows[i]["DOCUMENTDATE"]    = DateTime.Now.ToString("yyyyMMdd");
                    dt.Rows[i]["VENDORNO"]        = "";
                    dt.Rows[i]["INVOICECOUNT"]    = 1;
                    dt.Rows[i]["TAXATIONTYPE"]    = 1;
                    dt.Rows[i]["DISCOUNTDEVIDE"]  = 1;
                    dt.Rows[i]["DECLARATIONDATE"] = DateTime.Now.ToString("yyyyMM");
                    dt.Rows[i]["SALESTAXRATE"]    = 0.2;
                    dt.Rows[i]["COMPANYID"]       = "TLVN2";// qua serverchinh co the phai doi
                    dt.Rows[i]["KEYID"]           = TRANSORDERLINE.Rows[0]["KEYID"];
                    dt.Rows[i]["STOCKINTYPE"]     = 1;
                    dt.Rows[i]["TO001"]           = 1;
                    dt.Rows[i]["TO007"]           = TRANSORDERLINE.Rows[0]["TL011"];
                    dt.Rows[i]["TO008"]           = TRANSORDERLINE.Rows[0]["TL012"];
                    dt.Rows[i]["TO011"]           = 0;
                    dt.Rows[i]["TO012"]           = 0;
                    dt.Rows[i]["COINSTYPE"]       = "VND";
                    dt.Rows[i]["CONFIRMER"]       = Class.valiballecommon.GetStorage().UserName;
                    dt.Rows[i]["TO013"]           = 1;
                    dt.Rows[i]["TO014"]           = DBNull.Value;
                    dt.Rows[i]["TO015"]           = DBNull.Value;
                }
            }
            catch (Exception ex)
            {
                SystemLog.Output(SystemLog.MSG_TYPE.Err, " public DataTable GetDataSFTTRANSORDER(DataTable ERPPQC, DataTable TRANSORDERLINE)", ex.Message);
                dt = new DataTable();
            }
            return(dt);
        }
Ejemplo n.º 2
0
        public DataTable GetDataTableMOCTF(DataTable MOCTG, string TB002)
        {
            DataTable dt = new DataTable();

            try
            {
                dt = Database.MOC.MOCTF.GetTop1DataTable();
                Database.ADMMFUpdate           aDMMF            = new Database.ADMMFUpdate();
                DataTable                      dtADMMF          = aDMMF.GetDtADMFFByUser(Class.valiballecommon.GetStorage().UserName);
                Database.GetListWarehouse      getListWarehouse = new Database.GetListWarehouse();
                List <Database.WarehouseItems> listWarehouse    = getListWarehouse.GetWarehouseOnly();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["COMPANY"]     = dtADMMF.Rows[0]["COMPANY"];
                    dt.Rows[i]["CREATOR"]     = Class.valiballecommon.GetStorage().UserName;
                    dt.Rows[i]["USR_GROUP"]   = dtADMMF.Rows[0]["MF004"].ToString();
                    dt.Rows[i]["CREATE_DATE"] = DateTime.Now.ToString("yyyyMMdd");
                    dt.Rows[i]["MODIFIER"]    = DBNull.Value;
                    dt.Rows[i]["MODI_DATE"]   = DBNull.Value;
                    dt.Rows[i]["FLAG"]        = 1;
                    dt.Rows[i]["CREATE_TIME"] = DateTime.Now.ToString("HH:mm:ss");
                    dt.Rows[i]["CREATE_AP"]   = "SFT";
                    dt.Rows[i]["CREATE_PRID"] = "SFT";
                    dt.Rows[i]["MODI_TIME"]   = DBNull.Value;
                    dt.Rows[i]["MODI_AP"]     = DBNull.Value;
                    dt.Rows[i]["MODI_PRID"]   = DBNull.Value;
                    dt.Rows[i]["TF001"]       = MOCTG.Rows[0]["TG001"];
                    dt.Rows[i]["TF002"]       = MOCTG.Rows[0]["TG002"];
                    dt.Rows[i]["TF003"]       = DateTime.Now.ToString("yyyyMMdd");
                    dt.Rows[i]["TF004"]       = "TL";
                    dt.Rows[i]["TF005"]       = "";
                    dt.Rows[i]["TF006"]       = "Y";
                    dt.Rows[i]["TF007"]       = "N";
                    dt.Rows[i]["TF008"]       = 0;
                    dt.Rows[i]["TF009"]       = "N";
                    dt.Rows[i]["TF010"]       = "N";
                    dt.Rows[i]["TF011"]       = "B01";
                    dt.Rows[i]["TF012"]       = DateTime.Now.ToString("yyyyMMdd");
                    dt.Rows[i]["TF013"]       = Class.valiballecommon.GetStorage().UserName;
                    dt.Rows[i]["TF014"]       = "N";
                    dt.Rows[i]["TF015"]       = "0";
                    dt.Rows[i]["TF016"]       = 0;
                    dt.Rows[i]["TF017"]       = 0;
                    dt.Rows[i]["TF018"]       = 0;
                    dt.Rows[i]["TF019"]       = "";
                    dt.Rows[i]["TF020"]       = "";
                    dt.Rows[i]["TF021"]       = "";

                    dt.Rows[i]["UDF06"] = 0;
                    dt.Rows[i]["UDF07"] = 0;
                    dt.Rows[i]["UDF08"] = 0;
                    dt.Rows[i]["UDF09"] = 0;
                    dt.Rows[i]["UDF10"] = 0;


                    var SumQty = MOCTG.AsEnumerable().Sum(x => x.Field <decimal>("TG011"));
                    // dt.Rows[i]["TB200"] = SumQty;
                    dt.Rows[i]["TF200"] = SumQty;
                    dt.Rows[i]["TF201"] = 0;
                    dt.Rows[i]["TF202"] = 0;
                }
            }
            catch (Exception ex)
            {
                SystemLog.Output(SystemLog.MSG_TYPE.Err, "GetDataTableSFCTB", ex.Message);
            }
            return(dt);
        }
Ejemplo n.º 3
0
        public DataTable GetDataTableSFCTB(DataTable dtSFCTC, DataTable ERPPQC, string TransNo, string Confirm)
        {
            DataTable dt = new DataTable();

            try
            {
                dt = Database.SFC.SFCTB.GetTop1DataTable();
                Database.ADMMFUpdate           aDMMF            = new Database.ADMMFUpdate();
                DataTable                      dtADMMF          = aDMMF.GetDtADMFFByUser(Class.valiballecommon.GetStorage().UserName);
                Database.GetListWarehouse      getListWarehouse = new Database.GetListWarehouse();
                List <Database.WarehouseItems> listWarehouse    = getListWarehouse.GetWarehouseOnly();
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["COMPANY"]     = dtADMMF.Rows[0]["COMPANY"];
                    dt.Rows[i]["CREATOR"]     = Class.valiballecommon.GetStorage().UserName;
                    dt.Rows[i]["USR_GROUP"]   = dtADMMF.Rows[0]["MF004"].ToString();
                    dt.Rows[i]["CREATE_DATE"] = DateTime.Now.ToString("yyyyMMdd");
                    dt.Rows[i]["MODIFIER"]    = DBNull.Value;
                    dt.Rows[i]["MODI_DATE"]   = DBNull.Value;
                    dt.Rows[i]["FLAG"]        = 1;
                    dt.Rows[i]["CREATE_TIME"] = DateTime.Now.ToString("HH:mm:ss");
                    dt.Rows[i]["CREATE_AP"]   = "SFT";
                    dt.Rows[i]["CREATE_PRID"] = "SFT";
                    dt.Rows[i]["MODI_TIME"]   = DBNull.Value;
                    dt.Rows[i]["MODI_AP"]     = DBNull.Value;
                    dt.Rows[i]["MODI_PRID"]   = DBNull.Value;
                    dt.Rows[i]["TB001"]       = dtSFCTC.Rows[0]["TC001"];
                    dt.Rows[i]["TB002"]       = dtSFCTC.Rows[0]["TC002"];
                    dt.Rows[i]["TB003"]       = DateTime.Now.ToString("yyyyMMdd");
                    dt.Rows[i]["TB004"]       = "1";
                    dt.Rows[i]["TB005"]       = "B01";
                    dt.Rows[i]["TB006"]       = "?管OEM生??ONGOEM";
                    dt.Rows[i]["TB007"]       = "3";
                    dt.Rows[i]["TB008"]       = ERPPQC.Rows[0]["Warehouse"].ToString().Trim();
                    dt.Rows[i]["TB009"]       = listWarehouse.Where(d => d.MC001_Wh.Contains(ERPPQC.Rows[0]["Warehouse"].ToString())).Select(d => d.MC002_WhName).ToList()[0];
                    dt.Rows[i]["TB010"]       = "TL";
                    dt.Rows[i]["TB011"]       = 0;
                    dt.Rows[i]["TB012"]       = "N";
                    dt.Rows[i]["TB013"]       = Confirm;
                    dt.Rows[i]["TB015"]       = DateTime.Now.ToString("yyyyMMdd");
                    dt.Rows[i]["TB016"]       = Class.valiballecommon.GetStorage().UserName;
                    dt.Rows[i]["TB017"]       = "N";
                    dt.Rows[i]["TB018"]       = "";
                    dt.Rows[i]["TB019"]       = "1";
                    dt.Rows[i]["TB022"]       = "1";
                    dt.Rows[i]["TB023"]       = "1";
                    dt.Rows[i]["TB024"]       = "";
                    dt.Rows[i]["TB025"]       = DateTime.Now.ToString("yyyyMM");
                    dt.Rows[i]["TB026"]       = 0.2;
                    dt.Rows[i]["TB027"]       = 0;
                    dt.Rows[i]["TB029"]       = 0;
                    dt.Rows[i]["TB030"]       = 0;
                    dt.Rows[i]["TB031"]       = 0;
                    //DataTable dtSFCTA = Database.SFC.SFCTA.GetDataTableSFCTA(ERPPQC.Rows[i]["ProductOrder"].ToString());
                    //dt.Rows[i]["TB036"] = dtSFCTA.Rows[0]["TA018"].ToString();
                    dt.Rows[i]["TB037"] = 0;
                    dt.Rows[i]["TB038"] = Class.valiballecommon.GetStorage().DocNo;
                    dt.Rows[i]["TB039"] = TransNo;
                    dt.Rows[i]["UDF06"] = 0;
                    dt.Rows[i]["UDF07"] = 0;
                    dt.Rows[i]["UDF08"] = 0;
                    dt.Rows[i]["UDF09"] = 0;
                    dt.Rows[i]["UDF10"] = 0;


                    var SumQty = ERPPQC.Rows[i]["Quantity"].ToString().Trim();/*ERPPQC.AsEnumerable().Sum(x =>x.Field<decimal>("Quantity"));*/
                    dt.Rows[i]["TB200"] = SumQty;
                    dt.Rows[i]["TB201"] = SumQty;
                    dt.Rows[i]["TB202"] = 0;
                    dt.Rows[i]["TB042"] = "";
                }
            }
            catch (Exception ex)
            {
                SystemLog.Output(SystemLog.MSG_TYPE.Err, "GetDataTableSFCTB", ex.Message);
            }
            return(dt);
        }