Ejemplo n.º 1
0
        public int Add(FishEntity.PurchaseRequisitionEntity model)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("insert into t_purchaserequisition(ContractNo,supplier,SupplierId,DemandSide,DemandSideId,DateOfSigni,PlaceOfSign,ProductName,Unit,FishmealId,Variety,Quantity,NameOfTheShip,BillOfLadingNumber,DemandSideShort,SupplierAbbreviation,Ash,HTprotein,HTTVB,HTHistamine,HTFFA,HTFat,HTMoisture,HTSandAndSalt,HTSand,HTUnit,HTAsh,Lysine,Methionine,UnitPrice,AmountOfMoney,Protein,TVN,Histamine,FFA,Fat,Moisture,SandAndSalt,Sand,Rebate,USDollarPrice,Country,Brand,TradingLocations,TimeOfShipment,ExpectedDate,modifyman,modifytime,createman,createtime,Numbering,Openbank,accountnumber,Purchasingcontacts,deliverytime,PurchasingcontactsId,Remarks,Specification,MJAmount,validate)");
            strsql.Append("values(@ContractNo,@supplier,@SupplierId,@DemandSide,@DemandSideId,@DateOfSigni,@PlaceOfSign,@ProductName,@Unit,@FishmealId,@Variety,@Quantity,@NameOfTheShip,@BillOfLadingNumber,@DemandSideShort,@SupplierAbbreviation,@Ash,@HTprotein,@HTTVB,@HTHistamine,@HTFFA,@HTFat,@HTMoisture,@HTSandAndSalt,@HTSand,@HTUnit,@HTAsh,@Lysine,@Methionine,@UnitPrice,@AmountOfMoney,@Protein,@TVN,@Histamine,@FFA,@Fat,@Moisture,@SandAndSalt,@Sand,@Rebate,@USDollarPrice,@Country,@Brand,@TradingLocations,@TimeOfShipment,@ExpectedDate,@modifyman,@modifytime,@createman,@createtime,@Numbering,@Openbank,@accountnumber,@Purchasingcontacts,@deliverytime,@PurchasingcontactsId,@Remarks,@Specification,@MJAmount,@validate)");
            MySqlParameter[] parameter =
            {
                new MySqlParameter("@ContractNo",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@supplier",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@DemandSide",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@DateOfSigni",          MySqlDbType.DateTime),
                new MySqlParameter("@PlaceOfSign",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@ProductName",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Unit",                 MySqlDbType.VarChar,     45),
                new MySqlParameter("@Variety",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@Quantity",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@UnitPrice",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@AmountOfMoney",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Protein",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@TVN",                  MySqlDbType.VarChar,     45),
                new MySqlParameter("@Histamine",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@FFA",                  MySqlDbType.VarChar,     45),
                new MySqlParameter("@Fat",                  MySqlDbType.VarChar,     45),
                new MySqlParameter("@Moisture",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@SandAndSalt",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Sand",                 MySqlDbType.VarChar,     45),
                new MySqlParameter("@Rebate",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@USDollarPrice",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Country",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@TradingLocations",     MySqlDbType.VarChar,     45),
                new MySqlParameter("@TimeOfShipment",       MySqlDbType.DateTime),
                new MySqlParameter("@ExpectedDate",         MySqlDbType.DateTime),
                new MySqlParameter("@createman",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@createtime",           MySqlDbType.Timestamp),
                new MySqlParameter("@modifyman",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@modifytime",           MySqlDbType.Timestamp),
                new MySqlParameter("@Numbering",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@Openbank",             MySqlDbType.VarChar,    100),
                new MySqlParameter("@accountnumber",        MySqlDbType.VarChar,    100),
                new MySqlParameter("@Purchasingcontacts",   MySqlDbType.VarChar,     45),
                new MySqlParameter("@deliverytime",         MySqlDbType.DateTime),
                new MySqlParameter("@SupplierId",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@DemandSideId",         MySqlDbType.VarChar,     45),
                new MySqlParameter("@PurchasingcontactsId", MySqlDbType.VarChar,     45),
                new MySqlParameter("@FishmealId",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@Brand",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@Remarks",              MySqlDbType.VarChar,    500),
                new MySqlParameter("@NameOfTheShip",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@BillOfLadingNumber",   MySqlDbType.VarChar,     45),
                new MySqlParameter("@DemandSideShort",      MySqlDbType.VarChar,     45),
                new MySqlParameter("@SupplierAbbreviation", MySqlDbType.VarChar,     45),
                new MySqlParameter("@Ash",                  MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTprotein",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTTVB",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTHistamine",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTFFA",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTFat",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTMoisture",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTSandAndSalt",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTSand",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTUnit",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTAsh",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@Lysine",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@Methionine",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@Specification",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@MJAmount",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@validate",             MySqlDbType.VarChar, 45)
            };
            parameter[0].Value  = model.ContractNo;
            parameter[1].Value  = model.Supplier;
            parameter[2].Value  = model.DemandSide;
            parameter[3].Value  = model.DateOfSigni;
            parameter[4].Value  = model.PlaceOfSign;
            parameter[5].Value  = model.ProductName;
            parameter[6].Value  = model.Unit;
            parameter[7].Value  = model.Variety;
            parameter[8].Value  = model.Quantity;
            parameter[9].Value  = model.UnitPrice;
            parameter[10].Value = model.AmountOfMoney;
            parameter[11].Value = model.Protein;
            parameter[12].Value = model.TVN;
            parameter[13].Value = model.Histamine;
            parameter[14].Value = model.FFA;
            parameter[15].Value = model.Fat;
            parameter[16].Value = model.Moisture;
            parameter[17].Value = model.SandAndSalt;
            parameter[18].Value = model.Sand;
            parameter[19].Value = model.Rebate;
            parameter[20].Value = model.USDollarPrice;
            parameter[21].Value = model.Country;
            parameter[22].Value = model.TradingLocations;
            parameter[23].Value = model.TimeOfShipment;
            parameter[24].Value = model.ExpectedDate;
            parameter[25].Value = model.Createman;
            parameter[26].Value = model.Createtime;
            parameter[27].Value = model.Modifyman;
            parameter[28].Value = model.Modifytime;
            parameter[29].Value = model.Numbering;
            parameter[30].Value = model.Openbank;
            parameter[31].Value = model.Accountnumber;
            parameter[32].Value = model.Purchasingcontacts;
            parameter[33].Value = model.Deliverytime;
            parameter[34].Value = model.SupplierId;
            parameter[35].Value = model.DemandSideId;
            parameter[36].Value = model.PurchasingcontactsId;
            parameter[37].Value = model.FishmealId;
            parameter[38].Value = model.Brand;
            parameter[39].Value = model.Remarks;
            parameter[40].Value = model.NameOfTheShip;
            parameter[41].Value = model.BillOfLadingNumber;
            parameter[42].Value = model.DemandSideShort;
            parameter[43].Value = model.SupplierAbbreviation;
            parameter[44].Value = model.Ash;
            parameter[45].Value = model.HTprotein;
            parameter[46].Value = model.HTTVB;
            parameter[47].Value = model.HTHistamine;
            parameter[48].Value = model.HTFFA;
            parameter[49].Value = model.HTFat;
            parameter[50].Value = model.HTMoisture;
            parameter[51].Value = model.HTSandAndSalt;
            parameter[52].Value = model.HTSand;
            parameter[53].Value = model.HTUnit;
            parameter[54].Value = model.HTAsh;
            parameter[55].Value = model.Lysine;
            parameter[56].Value = model.Methionine;
            parameter[57].Value = model.Specification;
            parameter[58].Value = model.MJAmount;
            parameter[59].Value = model.validate;
            int id = MySqlHelper.ExecuteSql(strsql.ToString(), parameter);

            return(id);
        }
Ejemplo n.º 2
0
        public bool Update(FishEntity.PurchaseRequisitionEntity model)
        {
            StringBuilder strsql = new StringBuilder();

            strsql.Append("update t_purchaserequisition set ");
            strsql.Append("supplier = @supplier,");
            strsql.Append("ContractNo=@ContractNo,");
            strsql.Append("SupplierId = @SupplierId,");
            strsql.Append("DemandSide = @DemandSide,");
            strsql.Append("DemandSideId = @DemandSideId,");
            strsql.Append("DateOfSigni = @DateOfSigni,");
            strsql.Append("PlaceOfSign = @PlaceOfSign,");
            strsql.Append("ProductName = @ProductName,");
            strsql.Append("Unit = @Unit,");
            strsql.Append("FishmealId=@FishmealId,");
            strsql.Append("Variety = @Variety,");
            strsql.Append("Quantity = @Quantity,");
            strsql.Append("NameOfTheShip = @NameOfTheShip,");
            strsql.Append("BillOfLadingNumber = @BillOfLadingNumber,");
            strsql.Append("DemandSideShort = @DemandSideShort,");
            strsql.Append("SupplierAbbreviation = @SupplierAbbreviation,");
            strsql.Append("Ash = @Ash,");
            strsql.Append("HTprotein = @HTprotein,");
            strsql.Append("HTTVB = @HTTVB,");
            strsql.Append("HTHistamine = @HTHistamine,");
            strsql.Append("HTFFA = @HTFFA,");
            strsql.Append("HTFat = @HTFat,");
            strsql.Append("HTMoisture = @HTMoisture,");
            strsql.Append("HTSandAndSalt = @HTSandAndSalt,");
            strsql.Append("HTSand = @HTSand,");
            strsql.Append("HTUnit = @HTUnit,");
            strsql.Append("HTAsh = @HTAsh,");
            strsql.Append("Lysine = @Lysine,");
            strsql.Append("Methionine = @Methionine,");
            strsql.Append("Specification=@Specification,");
            strsql.Append("MJAmount=@MJAmount,");
            strsql.Append("UnitPrice = @UnitPrice,");
            strsql.Append("AmountOfMoney = @AmountOfMoney,");
            strsql.Append("Protein = @Protein,");
            strsql.Append("TVN = @TVN,");
            strsql.Append("Histamine = @Histamine,");
            strsql.Append("FFA = @FFA,");
            strsql.Append("Fat = @Fat,");
            strsql.Append("Moisture = @Moisture,");
            strsql.Append("SandAndSalt = @SandAndSalt,");
            strsql.Append("Sand = @Sand,");
            strsql.Append("Rebate = @Rebate,");
            strsql.Append("USDollarPrice = @USDollarPrice,");
            strsql.Append("Country = @Country,");
            strsql.Append("validate=@validate,");
            strsql.Append("Brand=@Brand,");
            strsql.Append("TradingLocations = @TradingLocations,");
            strsql.Append("TimeOfShipment = @TimeOfShipment,");
            strsql.Append("ExpectedDate = @ExpectedDate, ");
            strsql.Append("modifyman=@modifyman,");
            strsql.Append("modifytime=@modifytime, ");
            strsql.Append("Numbering=@Numbering, ");
            strsql.Append("Openbank=@Openbank, ");
            strsql.Append("accountnumber=@accountnumber, ");
            strsql.Append("Purchasingcontacts=@Purchasingcontacts,");
            strsql.Append("PurchasingcontactsId=@PurchasingcontactsId,");
            strsql.Append("deliverytime=@deliverytime,");
            strsql.Append("Remarks=@Remarks ");
            strsql.Append("where id = @id");
            MySqlParameter[] parameter =
            {
                new MySqlParameter("@supplier",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@DemandSide",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@DateOfSigni",          MySqlDbType.DateTime),
                new MySqlParameter("@PlaceOfSign",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@ProductName",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Unit",                 MySqlDbType.VarChar,     45),
                new MySqlParameter("@Variety",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@Quantity",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@UnitPrice",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@AmountOfMoney",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Protein",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@TVN",                  MySqlDbType.VarChar,     45),
                new MySqlParameter("@Histamine",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@FFA",                  MySqlDbType.VarChar,     45),
                new MySqlParameter("@Fat",                  MySqlDbType.VarChar,     45),
                new MySqlParameter("@Moisture",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@SandAndSalt",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@Sand",                 MySqlDbType.VarChar,     45),
                new MySqlParameter("@Rebate",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@USDollarPrice",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@Country",              MySqlDbType.VarChar,     45),
                new MySqlParameter("@TradingLocations",     MySqlDbType.VarChar,     45),
                new MySqlParameter("@TimeOfShipment",       MySqlDbType.DateTime),
                new MySqlParameter("@ExpectedDate",         MySqlDbType.DateTime),
                new MySqlParameter("@modifyman",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@modifytime",           MySqlDbType.Timestamp),
                new MySqlParameter("@Numbering",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@Openbank",             MySqlDbType.VarChar,    100),
                new MySqlParameter("@accountnumber",        MySqlDbType.VarChar,    100),
                new MySqlParameter("@id",                   MySqlDbType.Int32,       11),
                new MySqlParameter("@deliverytime",         MySqlDbType.DateTime),
                new MySqlParameter("@SupplierId",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@Purchasingcontacts",   MySqlDbType.VarChar,     45),
                new MySqlParameter("@DemandSideId",         MySqlDbType.VarChar,     45),
                new MySqlParameter("@PurchasingcontactsId", MySqlDbType.VarChar,     45),
                new MySqlParameter("@FishmealId",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@Brand",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@Remarks",              MySqlDbType.VarChar,    500),
                new MySqlParameter("@ContractNo",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@NameOfTheShip",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@BillOfLadingNumber",   MySqlDbType.VarChar,     45),
                new MySqlParameter("@DemandSideShort",      MySqlDbType.VarChar,     45),
                new MySqlParameter("@SupplierAbbreviation", MySqlDbType.VarChar,     45),
                new MySqlParameter("@Ash",                  MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTprotein",            MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTTVB",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTHistamine",          MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTFFA",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTFat",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTMoisture",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTSandAndSalt",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTSand",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTUnit",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@HTAsh",                MySqlDbType.VarChar,     45),
                new MySqlParameter("@Lysine",               MySqlDbType.VarChar,     45),
                new MySqlParameter("@Methionine",           MySqlDbType.VarChar,     45),
                new MySqlParameter("@Specification",        MySqlDbType.VarChar,     45),
                new MySqlParameter("@MJAmount",             MySqlDbType.VarChar,     45),
                new MySqlParameter("@validate",             MySqlDbType.VarChar, 45)
            };
            parameter[0].Value  = model.Supplier;
            parameter[1].Value  = model.DemandSide;
            parameter[2].Value  = model.DateOfSigni;
            parameter[3].Value  = model.PlaceOfSign;
            parameter[4].Value  = model.ProductName;
            parameter[5].Value  = model.Unit;
            parameter[6].Value  = model.Variety;
            parameter[7].Value  = model.Quantity;
            parameter[8].Value  = model.UnitPrice;
            parameter[9].Value  = model.AmountOfMoney;
            parameter[10].Value = model.Protein;
            parameter[11].Value = model.TVN;
            parameter[12].Value = model.Histamine;
            parameter[13].Value = model.FFA;
            parameter[14].Value = model.Fat;
            parameter[15].Value = model.Moisture;
            parameter[16].Value = model.SandAndSalt;
            parameter[17].Value = model.Sand;
            parameter[18].Value = model.Rebate;
            parameter[19].Value = model.USDollarPrice;
            parameter[20].Value = model.Country;
            parameter[21].Value = model.TradingLocations;
            parameter[22].Value = model.TimeOfShipment;
            parameter[23].Value = model.ExpectedDate;
            parameter[24].Value = model.Modifyman;
            parameter[25].Value = model.Modifytime;
            parameter[26].Value = model.Numbering;
            parameter[27].Value = model.Openbank;
            parameter[28].Value = model.Accountnumber;
            parameter[29].Value = model.Id;
            parameter[30].Value = model.Deliverytime;
            parameter[31].Value = model.SupplierId;
            parameter[32].Value = model.Purchasingcontacts;
            parameter[33].Value = model.DemandSideId;
            parameter[34].Value = model.PurchasingcontactsId;
            parameter[35].Value = model.FishmealId;
            parameter[36].Value = model.Brand;
            parameter[37].Value = model.Remarks;
            parameter[38].Value = model.ContractNo;
            parameter[39].Value = model.NameOfTheShip;
            parameter[40].Value = model.BillOfLadingNumber;
            parameter[41].Value = model.DemandSideShort;
            parameter[42].Value = model.SupplierAbbreviation;
            parameter[43].Value = model.Ash;
            parameter[44].Value = model.HTprotein;
            parameter[45].Value = model.HTTVB;
            parameter[46].Value = model.HTHistamine;
            parameter[47].Value = model.HTFFA;
            parameter[48].Value = model.HTFat;
            parameter[49].Value = model.HTMoisture;
            parameter[50].Value = model.HTSandAndSalt;
            parameter[51].Value = model.HTSand;
            parameter[52].Value = model.HTUnit;
            parameter[53].Value = model.HTAsh;
            parameter[54].Value = model.Lysine;
            parameter[55].Value = model.Methionine;
            parameter[56].Value = model.Specification;
            parameter[57].Value = model.MJAmount;
            parameter[58].Value = model.validate;
            int row = MySqlHelper.ExecuteSql(strsql.ToString(), parameter);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }