Exemple #1
0
        public DataTable dgvGetOldData()
        {
            MilkTransaction objMilkTransaction = new MilkTransaction();

            _fromDate = DtpFrom.Value;
            _toDate   = DtpTo.Value;


            objMilkTransaction.FromDate = Convert.ToDateTime(_fromDate.ToString("yyyy/MM/dd"));

            objMilkTransaction.ToDate = Convert.ToDateTime(_toDate.ToString("yyyy/MM/dd"));
            DataTable dt = objMilkTransaction.GetActiveRecord(objMilkTransaction);

            //if (dt != null && dt.Rows.Count > 0)
            //{
            //    foreach (DataRow row in dt.Rows)
            //    {
            //        GetTotal(row["Fat"].ToString(), row["Animal"].ToString(), row["Quantity"].ToString());

            //        row["NewRate"] = _newRate.ToString("0.00");
            //        row["NewAmount"] = _newAmt.ToString("0.00");
            //        row["NewMemberRate"] = _memberRate.ToString("0.00");
            //    }
            //}

            return(dt);
        }
Exemple #2
0
        public int dgvUpdateOldData()
        {
            int             updateFlag         = 0;
            MilkTransaction objMilkTransaction = new MilkTransaction();

            _fromDate = DtpFrom.Value;
            _toDate   = DtpTo.Value;
            int FillUpId = 0;

            objMilkTransaction.FromDate = Convert.ToDateTime(_fromDate.ToString("yyyy/MM/dd"));

            objMilkTransaction.ToDate = Convert.ToDateTime(_toDate.ToString("yyyy/MM/dd"));
            DataTable dt = objMilkTransaction.GetActiveRecord(objMilkTransaction);

            if (dt != null && dt.Rows.Count > 0)
            {
                //foreach (DataRow row in dt.Rows)
                //{
                //    //GetTotal(row["Fat"].ToString(), row["Animal"].ToString(), row["Quantity"].ToString());
                //    //_date = row["Date"].ToString();
                //    //row["NewRate"] = _newRate.ToString();
                //    //row["NewAmount"] = _newAmt.ToString();
                //    //row["NewMemberRate"] = _memberRate.ToString();
                //    //objMilkTransaction.Date = DateTime.Parse(_date);
                //    //objMilkTransaction.Shift = row["Shift"].ToString();
                //     objMilkTransaction.FillUpId = int.Parse(row["SrNo."].ToString());
                //    //[Sr No.]
                //    objMilkTransaction.MemberCode = row["MemberCode"].ToString();
                //    //objMilkTransaction.Amount = Convert.ToDecimal(row["NewAmount"].ToString());

                //    updateFlag = objMilkTransaction.UpdateMilkTransaction(objMilkTransaction);
                //    //objMilkTransaction.Rate = Convert.ToDecimal(row["NewRate"].ToString());
                //    //objMilkTransaction.MemberRate = Convert.ToDecimal(row["NewMemberRate"].ToString());


                //}
                genericDbHandler.SqlBulkUpdate(dt);
                return(1);
            }

            return(updateFlag);
        }