Ejemplo n.º 1
0
        public string[] UpdatePartReceipt_TempData(string SessionID, string CurrentObjectName, string UserID, POR_SP_GetPartDetails_OfGRN_Result Receipt, string[] conn)
        {
            string[] result;
            result = new string[] { "0", "0" };
            try
            {
                BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
                List <POR_SP_GetPartDetails_OfGRN_Result> getRec = new List <POR_SP_GetPartDetails_OfGRN_Result>();
                getRec = GetExistingTempDataBySessionIDObjectName(SessionID, UserID, CurrentObjectName, conn);

                POR_SP_GetPartDetails_OfGRN_Result updateRec = new POR_SP_GetPartDetails_OfGRN_Result();
                updateRec = getRec.Where(g => g.Sequence == Receipt.Sequence).FirstOrDefault();

                updateRec.ReceivedQty = Receipt.ReceivedQty;
                updateRec.ExcessQty   = 0;
                updateRec.ShortQty    = 0;
                if (updateRec.ReceivedQty > updateRec.ChallanQty)
                {
                    updateRec.ExcessQty = updateRec.ReceivedQty - updateRec.ChallanQty;
                }
                else if (updateRec.ReceivedQty < updateRec.ChallanQty)
                {
                    updateRec.ShortQty = updateRec.ChallanQty - updateRec.ReceivedQty;
                }
                result = new string[] { updateRec.ExcessQty.Value.ToString(), updateRec.ShortQty.Value.ToString() };
                SaveTempDataToDB(getRec, SessionID, UserID, CurrentObjectName, conn);
            }
            catch { }
            finally { }
            return(result);
        }
Ejemplo n.º 2
0
        public static string[] WMUpdateReceiptQty(object objReceipt)
        {
            string[]           QtyResult  = new string[] { };
            iPartReceiptClient objService = new iPartReceiptClient();

            try
            {
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objReceipt;
                CustomProfile profile = CustomProfile.GetProfile();

                POR_SP_GetPartDetails_OfGRN_Result ReceiptRec = new POR_SP_GetPartDetails_OfGRN_Result();
                ReceiptRec.Sequence    = Convert.ToInt64(dictionary["Sequence"]);
                ReceiptRec.ReceivedQty = Convert.ToDecimal(dictionary["ReceivedQty"]);
                QtyResult = objService.UpdatePartReceipt_TempData(HttpContext.Current.Session.SessionID, ObjectName, profile.Personal.UserID.ToString(), ReceiptRec, profile.DBConnection._constr);
            }
            catch { }
            finally { objService.Close(); }
            return(QtyResult);
        }