Beispiel #1
0
 void UpdateStock()
 {
     var ta = new DataSet1TableAdapters.STOCKMASTERTableAdapter();
     ta.Fill(this.dataSet1.STOCKMASTER);
     foreach (DataRow d in this.dataSet1.RETURNDETAIL)
     {
        var dr  =  this.dataSet1.STOCKMASTER.FindBySTOCKID(int.Parse(d["STOCKID"].ToString()));
       // var d1 = this.dataSet1.STOCKMASTER.Rows.Find(int.Parse(d["STOCKID"].ToString()));
        if (dr != null)
        {
            dr["QTY"] = decimal.Parse(dr["QTY"].ToString()) - decimal.Parse(d["QTY"].ToString()) + decimal.Parse(d["BONUSQTY"].ToString());
            ta.Update(this.dataSet1.STOCKMASTER);
        }
         //foreach(DataRow dr in this.dataSet1.STOCKMASTER)
         //{
         //    dr["QTY"] =  decimal.Parse(dr["QTY"].ToString()) -  decimal.Parse(d["QTY"].ToString()) + decimal.Parse(d["BONUSQTY"].ToString());
         //   ta.Update(this.dataSet1.STOCKMASTER);
         //}
     }
    // this.stockmasterTableAdapter1.Update(this.dataSet1.STOCKMASTER);
 }
Beispiel #2
0
 void UpdateStock()
 {
     var ta = new DataSet1TableAdapters.STOCKMASTERTableAdapter();
     ta.Fill(this.dataSet1.STOCKMASTER);
     foreach (DataRow d in this.dataSet1.ITEMTRANSFERDETAIL)
     {
         var dr = this.dataSet1.STOCKMASTER.FindBySTOCKID(int.Parse(d["STOCKID"].ToString()));
         if (dr != null)
         {
             dr["QTY"] = decimal.Parse(dr["QTY"].ToString()) - decimal.Parse(d["QTY"].ToString());
             ta.Update(this.dataSet1.STOCKMASTER);
         }
     }
 }
Beispiel #3
0
 void UpdateStock()
 {
     var ta = new DataSet1TableAdapters.STOCKMASTERTableAdapter();
     ta.Fill(this.dataSet1.STOCKMASTER);
     foreach (DataRow d in this.dataSet1.ADJDETAIL)
     {
        var dr  =  this.dataSet1.STOCKMASTER.FindBySTOCKID(int.Parse(d["STOCKID"].ToString()));
        if (dr != null)
        {
            if (!string.IsNullOrEmpty(d["ADJQTY"].ToString()))
            {
                dr["QTY"] = decimal.Parse(d["ADJQTY"].ToString());
            }
            if (!string.IsNullOrEmpty(d["ADJEXPDATE"].ToString()))
            {
                dr["EXPDATE"] = decimal.Parse(d["ADJEXPDATE"].ToString());
            }
            if (!string.IsNullOrEmpty(d["ADJSPRICE"].ToString()))
            {
                dr["SPRICE"] = decimal.Parse(d["ADJSPRICE"].ToString());
            }
            if (!string.IsNullOrEmpty(d["ADJSPRICE"].ToString()))
            {
                dr["CPRICE"] = decimal.Parse(d["ADJCPRICE"].ToString());
            }
            if (!string.IsNullOrEmpty(d["CHORDER"].ToString()))
            {
                dr["SALESORDER"] = decimal.Parse(d["CHORDER"].ToString());
            }
            ta.Update(this.dataSet1.STOCKMASTER);
        }
     }
 }