Beispiel #1
0
        public string SaveCallBillingDocMaster(CallBillingDocMaster argCallBillingDocMaster, DataAccess da, List <ErrorHandler> lstErr)
        {
            string strRetValue = "";

            try
            {
                if (blnIsCallBillingDocMasterExists(argCallBillingDocMaster.CallBillingDocCode, argCallBillingDocMaster.PartnerCode, argCallBillingDocMaster.ClientCode, da) == false)
                {
                    strRetValue = InsertCallBillingDocMaster(argCallBillingDocMaster, da, lstErr);
                }
                else
                {
                    strRetValue = UpdateCallBillingDocMaster(argCallBillingDocMaster, da, lstErr);
                }
            }
            catch (Exception ex)
            {
                objErrorHandler.Type       = ErrorConstant.strAboartType;
                objErrorHandler.MsgId      = 0;
                objErrorHandler.Module     = ErrorConstant.strInsertModule;
                objErrorHandler.ModulePart = ErrorConstant.strDetailModule;
                objErrorHandler.Message    = ex.Message.ToString();
                objErrorHandler.RowNo      = 0;
                objErrorHandler.FieldName  = "";
                objErrorHandler.LogCode    = "";
                lstErr.Add(objErrorHandler);
            }

            return(strRetValue);
        }
Beispiel #2
0
        private CallBillingDocMaster objCreateCallBillingDocMaster(DataRow dr)
        {
            CallBillingDocMaster tCallBillingDocMaster = new CallBillingDocMaster();

            tCallBillingDocMaster.SetObjectInfo(dr);

            return(tCallBillingDocMaster);
        }
Beispiel #3
0
        public string UpdateCallBillingDocMaster(CallBillingDocMaster argCallBillingDocMaster, DataAccess da, List <ErrorHandler> lstErr)
        {
            SqlParameter[] param = new SqlParameter[16];
            param[0]  = new SqlParameter("@CallBillingDocCode", argCallBillingDocMaster.CallBillingDocCode);
            param[1]  = new SqlParameter("@CallBillingDocTypeCode", argCallBillingDocMaster.CallBillingDocTypeCode);
            param[2]  = new SqlParameter("@BillingDate", argCallBillingDocMaster.BillingDate);
            param[3]  = new SqlParameter("@CallClosingCode", argCallBillingDocMaster.CallClosingCode);
            param[4]  = new SqlParameter("@GrossValue", argCallBillingDocMaster.GrossValue);
            param[5]  = new SqlParameter("@DiscPer", argCallBillingDocMaster.DiscPer);
            param[6]  = new SqlParameter("@DiscValue", argCallBillingDocMaster.DiscValue);
            param[7]  = new SqlParameter("@NetValue", argCallBillingDocMaster.NetValue);
            param[8]  = new SqlParameter("@PaidValue", argCallBillingDocMaster.PaidValue);
            param[9]  = new SqlParameter("@PartnerCode", argCallBillingDocMaster.PartnerCode);
            param[10] = new SqlParameter("@ClientCode", argCallBillingDocMaster.ClientCode);
            param[11] = new SqlParameter("@CreatedBy", argCallBillingDocMaster.CreatedBy);
            param[12] = new SqlParameter("@ModifiedBy", argCallBillingDocMaster.ModifiedBy);

            param[13]           = new SqlParameter("@Type", SqlDbType.Char);
            param[13].Size      = 1;
            param[13].Direction = ParameterDirection.Output;

            param[14]           = new SqlParameter("@Message", SqlDbType.VarChar);
            param[14].Size      = 255;
            param[14].Direction = ParameterDirection.Output;

            param[15]           = new SqlParameter("@returnvalue", SqlDbType.VarChar);
            param[15].Size      = 20;
            param[15].Direction = ParameterDirection.Output;

            int i = da.NExecuteNonQuery("Proc_UpdateCallBillingDocMaster", param);


            string strMessage  = Convert.ToString(param[14].Value);
            string strType     = Convert.ToString(param[13].Value);
            string strRetValue = Convert.ToString(param[15].Value);


            objErrorHandler.Type       = strType;
            objErrorHandler.MsgId      = 0;
            objErrorHandler.Module     = ErrorConstant.strInsertModule;
            objErrorHandler.ModulePart = ErrorConstant.strMasterModule;
            objErrorHandler.Message    = strMessage.ToString();
            objErrorHandler.RowNo      = 0;
            objErrorHandler.FieldName  = "";
            objErrorHandler.LogCode    = "";
            lstErr.Add(objErrorHandler);

            return(strRetValue);
        }
Beispiel #4
0
        public CallBillingDocMaster objGetCallBillingDocMaster(string argCallBillingDocCode, string argPartnerCode, string argClientCode)
        {
            CallBillingDocMaster argCallBillingDocMaster = new CallBillingDocMaster();
            DataSet DataSetToFill = new DataSet();

            if (argCallBillingDocCode.Trim() == "")
            {
                goto ErrorHandlers;
            }

            if (argPartnerCode.Trim() == "")
            {
                goto ErrorHandlers;
            }

            if (argClientCode.Trim() == "")
            {
                goto ErrorHandlers;
            }

            DataSetToFill = this.GetCallBillingDocMaster(argCallBillingDocCode, argPartnerCode, argClientCode);

            if (DataSetToFill.Tables[0].Rows.Count <= 0)
            {
                goto Finish;
            }

            argCallBillingDocMaster = this.objCreateCallBillingDocMaster((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;


            return(argCallBillingDocMaster);
        }
Beispiel #5
0
        public ICollection <CallBillingDocMaster> colGetCallBillingDocMaster(string argPartnerCode, string argClientCode)
        {
            List <CallBillingDocMaster> lst            = new List <CallBillingDocMaster>();
            DataSet DataSetToFill                      = new DataSet();
            CallBillingDocMaster tCallBillingDocMaster = new CallBillingDocMaster();

            DataSetToFill = this.GetCallBillingDocMaster(argPartnerCode, argClientCode);

            if (DataSetToFill != null)
            {
                foreach (DataRow dr in DataSetToFill.Tables[0].Rows)
                {
                    lst.Add(objCreateCallBillingDocMaster(dr));
                }
            }
            goto Finish;

Finish:
            DataSetToFill = null;


            return(lst);
        }
Beispiel #6
0
        public ICollection <ErrorHandler> SaveCallBillingDocMaster(CallBillingDocMaster argCallBillingDocMaster)
        {
            List <ErrorHandler> lstErr = new List <ErrorHandler>();
            DataAccess          da     = new DataAccess();

            try
            {
                if (blnIsCallBillingDocMasterExists(argCallBillingDocMaster.CallBillingDocCode, argCallBillingDocMaster.PartnerCode, argCallBillingDocMaster.ClientCode) == false)
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    InsertCallBillingDocMaster(argCallBillingDocMaster, da, lstErr);
                    foreach (ErrorHandler objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                }
                else
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    UpdateCallBillingDocMaster(argCallBillingDocMaster, da, lstErr);
                    foreach (ErrorHandler objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (da != null)
                {
                    da.ROLLBACK_TRANSACTION();
                }
                objErrorHandler.Type       = ErrorConstant.strAboartType;
                objErrorHandler.MsgId      = 0;
                objErrorHandler.Module     = ErrorConstant.strInsertModule;
                objErrorHandler.ModulePart = ErrorConstant.strMasterModule;
                objErrorHandler.Message    = ex.Message.ToString();
                objErrorHandler.RowNo      = 0;
                objErrorHandler.FieldName  = "";
                objErrorHandler.LogCode    = "";
                lstErr.Add(objErrorHandler);
            }
            finally
            {
                if (da != null)
                {
                    da.Close_Connection();
                    da = null;
                }
            }
            return(lstErr);
        }
        public PartnerErrorResult SaveCallClosingDetails(CallClosingMaster argCallClosingMaster, CallClosingDetailCol argCallClosingDetailCol, CallBillingDocMaster argCallBillingDocMaster, CallBillingDocCol argCallBillingDocCol, string argPartnerCode, string argClientCode, string argUserName)
        {
            List <ErrorHandler>         lstErr                      = new List <ErrorHandler>();
            PartnerErrorResult          errorcol                    = new PartnerErrorResult();
            PartnerGoodsMovementManager objPartnerGMManager         = new PartnerGoodsMovementManager();
            CallClosingMasterManager    objCallClosingMasterManager = new CallClosingMasterManager();
            DataAccess da          = new DataAccess();
            string     strRetValue = "";

            try
            {
                da.Open_Connection();
                da.BEGIN_TRANSACTION();

                string strGoodsMovementCode = "";
                int    ictr = 0;
                strGoodsMovementCode = objPartnerGMManager.GenerateGMCode("NEW", "GM01", argPartnerCode, argClientCode, da);

                if (argCallClosingMaster != null)
                {
                    objCallClosingMasterManager.SaveCallClosingMaster(argCallClosingMaster, da, lstErr);
                }

                foreach (ErrorHandler objerr in lstErr)
                {
                    if (objerr.Type == "E")
                    {
                        errorcol.colErrorHandler.Add(objerr);
                        da.ROLLBACK_TRANSACTION();
                        return(errorcol);
                    }

                    if (objerr.Type == "A")
                    {
                        errorcol.colErrorHandler.Add(objerr);
                        da.ROLLBACK_TRANSACTION();
                        return(errorcol);
                    }
                }

                foreach (CallClosingDetails argCallClosingDetails in argCallClosingDetailCol.colCallClosingDetail)
                {
                    ictr = ictr + 1;

                    if (blnIsCallClosingDetailsExists(argCallClosingDetails.CallClosingCode, argCallClosingDetails.CallCode, argCallClosingDetails.CallItemNo, argCallClosingDetails.PartnerCode, argCallClosingDetails.ClientCode, da) == false)
                    {
                        argCallClosingDetails.PGoodsMovementCode = strGoodsMovementCode;
                        argCallClosingDetails.GMItemNo           = ictr;

                        InsertCallClosingDetails(argCallClosingDetails, da, lstErr);
                    }
                    else
                    {
                        UpdateCallClosingDetails(argCallClosingDetails, da, lstErr);
                    }
                }

                foreach (ErrorHandler objerr in lstErr)
                {
                    if (objerr.Type == "E")
                    {
                        errorcol.colErrorHandler.Add(objerr);
                        da.ROLLBACK_TRANSACTION();
                        return(errorcol);
                    }

                    if (objerr.Type == "A")
                    {
                        errorcol.colErrorHandler.Add(objerr);
                        da.ROLLBACK_TRANSACTION();
                        return(errorcol);
                    }
                }

                /*--------------------Billing Document---------------------------------------------------------------*/

                if (argCallBillingDocMaster != null)
                {
                    if (argCallBillingDocCol.colCallBillingDoc.Count > 0)
                    {
                        string srtNewCallBillingDocCode = "";
                        srtNewCallBillingDocCode = objCallBillingDocMasterManager.GenerateCallBillingDocCode(argCallBillingDocMaster.CallBillingDocCode, argCallBillingDocMaster.CallBillingDocTypeCode, argCallBillingDocMaster.PartnerCode, argCallBillingDocMaster.ClientCode, da);

                        argCallBillingDocMaster.CallBillingDocCode = srtNewCallBillingDocCode;
                        strRetValue = objCallBillingDocMasterManager.SaveCallBillingDocMaster(argCallBillingDocMaster, da, lstErr);

                        foreach (ErrorHandler objerr in lstErr)
                        {
                            if (objerr.Type == "E")
                            {
                                errorcol.colErrorHandler.Add(objerr);
                                da.ROLLBACK_TRANSACTION();
                                return(errorcol);
                            }

                            if (objerr.Type == "A")
                            {
                                errorcol.colErrorHandler.Add(objerr);
                                da.ROLLBACK_TRANSACTION();
                                return(errorcol);
                            }
                        }

                        if (strRetValue != "")
                        {
                            foreach (CallBillingDoc objCallBillingDoc in argCallBillingDocCol.colCallBillingDoc)
                            {
                                objCallBillingDoc.CallBillingDocCode = strRetValue;
                                objCallBillingDocManager.SaveCallBillingDoc(objCallBillingDoc, da, lstErr);
                            }

                            foreach (ErrorHandler objerr in lstErr)
                            {
                                if (objerr.Type == "E")
                                {
                                    errorcol.colErrorHandler.Add(objerr);
                                    da.ROLLBACK_TRANSACTION();
                                    return(errorcol);
                                }

                                if (objerr.Type == "A")
                                {
                                    errorcol.colErrorHandler.Add(objerr);
                                    da.ROLLBACK_TRANSACTION();
                                    return(errorcol);
                                }
                            }
                        }
                    }
                }

                /*--------------------------------------------------------------------------------------------*/



                /* Partner Goods Movement Declared */
                PartnerGoodsMovement objPartnerGM = new PartnerGoodsMovement();

                objPartnerGM.PGoodsMovementCode      = strGoodsMovementCode;
                objPartnerGM.PartnerGMDocTypeCode    = "GM01";
                objPartnerGM.FromPlantCode           = "";
                objPartnerGM.FromPartnerCode         = argPartnerCode;
                objPartnerGM.FromPartnerEmployeeCode = "";
                objPartnerGM.FromStoreCode           = "";
                objPartnerGM.ToPartnerCode           = "";
                objPartnerGM.ToPlantCode             = "";
                objPartnerGM.ToStoreCode             = "";
                objPartnerGM.ToPartnerEmployeeCode   = "";
                objPartnerGM.ClientCode    = argClientCode;
                objPartnerGM.CreatedBy     = argUserName;
                objPartnerGM.ModifiedBy    = argUserName;
                objPartnerGM.TotalQuantity = 0;
                objPartnerGM.PartnerCode   = Convert.ToString(argPartnerCode);
                objPartnerGM.GoodsMovDate  = Convert.ToDateTime(DateTime.Now);
                /*----------------------------------------------------------------------------------------*/
                /* Partner Goods Movement Detail */
                PartnerMaterialDocTypeManager objPartnerMatDocTypeMan = new PartnerMaterialDocTypeManager();

                PartnerGoodsMovementDetailCol  objPartnerGMCol       = new PartnerGoodsMovementDetailCol();
                PartnerGoodsMovSerialDetailCol objPartnerGMSerialCol = new PartnerGoodsMovSerialDetailCol();

                objPartnerGMCol.colPartnerGMDetail             = new List <PartnerGoodsMovementDetail>();
                objPartnerGMSerialCol.colPartnerGMSerialDetail = new List <PartnerGoodsMovSerialDetail>();

                DataSet dsMatDocType = null;
                bool    IsNew        = true;
                int     tmpItemNo    = 0;

                ictr = 0;
                foreach (CallClosingDetails argCallClosingDetails in argCallClosingDetailCol.colCallClosingDetail)
                {
                    if (argCallClosingDetails.IsDeleted == 0)
                    {
                        dsMatDocType = new DataSet();
                        if (IsNew == true)
                        {
                            ictr         = ictr + 1;
                            dsMatDocType = objPartnerMatDocTypeMan.GetPartnerMaterialDocType(argCallClosingDetails.MaterialDocTypeCode, argCallClosingDetails.ClientCode, da);

                            PartnerGoodsMovementDetail objPartnerGMDetailsnew = new PartnerGoodsMovementDetail();
                            objPartnerGMDetailsnew.PGoodsMovementCode = strGoodsMovementCode;
                            objPartnerGMDetailsnew.ItemNo             = ictr;
                            tmpItemNo = ictr;
                            objPartnerGMDetailsnew.MaterialCode        = Convert.ToString(argCallClosingDetails.MaterialCode);
                            objPartnerGMDetailsnew.MatGroup1Code       = Convert.ToString(argCallClosingDetails.MatGroup1Code);
                            objPartnerGMDetailsnew.StockIndicator      = Convert.ToString(argCallClosingDetails.StockIndicator);
                            objPartnerGMDetailsnew.ToStockIndicator    = Convert.ToString("");
                            objPartnerGMDetailsnew.Quantity            = Convert.ToInt32(argCallClosingDetails.Quantity);
                            objPartnerGMDetailsnew.UOMCode             = Convert.ToString(argCallClosingDetails.UOMCode);
                            objPartnerGMDetailsnew.ClientCode          = Convert.ToString(argCallClosingDetails.ClientCode);
                            objPartnerGMDetailsnew.CreatedBy           = Convert.ToString(argCallClosingDetails.CreatedBy);
                            objPartnerGMDetailsnew.ModifiedBy          = Convert.ToString(argCallClosingDetails.ModifiedBy);
                            objPartnerGMDetailsnew.TranRefDocCode      = Convert.ToString(argCallClosingDetails.CallClosingCode);
                            objPartnerGMDetailsnew.TranRefDocItemNo    = Convert.ToInt32(ictr);
                            objPartnerGMDetailsnew.MaterialDocTypeCode = Convert.ToString(argCallClosingDetails.MaterialDocTypeCode);
                            objPartnerGMDetailsnew.PartnerCode         = Convert.ToString(argPartnerCode);


                            if (dsMatDocType != null)
                            {
                                if (dsMatDocType.Tables[0].Rows.Count > 0)
                                {
                                    if (dsMatDocType.Tables[0].Rows[0]["FromPlant"].ToString() != "Hide")
                                    {
                                        objPartnerGMDetailsnew.FromPlantCode = "";
                                    }
                                    else
                                    {
                                        objPartnerGMDetailsnew.FromPlantCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["FromPartner"].ToString() != "Hide")
                                    {
                                        objPartnerGMDetailsnew.FromPartnerCode = Convert.ToString(argCallClosingDetails.PartnerCode);
                                    }
                                    else
                                    {
                                        objPartnerGMDetailsnew.FromPartnerCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["FromStore"].ToString() != "Hide")
                                    {
                                        objPartnerGMDetailsnew.FromStoreCode = Convert.ToString(argCallClosingDetails.StoreCode);
                                    }
                                    else
                                    {
                                        objPartnerGMDetailsnew.FromStoreCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["FromEmployee"].ToString() != "Hide")
                                    {
                                        objPartnerGMDetailsnew.FromPartnerEmployeeCode = "";
                                    }
                                    else
                                    {
                                        objPartnerGMDetailsnew.FromPartnerEmployeeCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToPartner"].ToString() != "Hide")
                                    {
                                        objPartnerGMDetailsnew.ToPartnerCode = Convert.ToString("");
                                    }
                                    else
                                    {
                                        objPartnerGMDetailsnew.ToPartnerCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToStore"].ToString() != "Hide")
                                    {
                                        objPartnerGMDetailsnew.ToStoreCode = Convert.ToString("");
                                    }
                                    else
                                    {
                                        objPartnerGMDetailsnew.ToStoreCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToEmployee"].ToString() != "Hide")
                                    {
                                        objPartnerGMDetailsnew.ToPartnerEmployeeCode = Convert.ToString("");
                                    }
                                    else
                                    {
                                        objPartnerGMDetailsnew.ToPartnerEmployeeCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToPlant"].ToString() != "Hide")
                                    {
                                        objPartnerGMDetailsnew.ToPlantCode = "";
                                    }
                                    else
                                    {
                                        objPartnerGMDetailsnew.ToPlantCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToMaterialCode"].ToString() != "Hide")
                                    {
                                        objPartnerGMDetailsnew.ToMaterialCode = Convert.ToString("");
                                    }
                                    else
                                    {
                                        objPartnerGMDetailsnew.ToMaterialCode = "";
                                    }
                                }
                                else
                                {
                                    objPartnerGMDetailsnew.FromPlantCode           = "";
                                    objPartnerGMDetailsnew.FromPartnerCode         = Convert.ToString(argCallClosingDetails.PartnerCode);
                                    objPartnerGMDetailsnew.FromPartnerEmployeeCode = "";
                                    objPartnerGMDetailsnew.FromStoreCode           = Convert.ToString(argCallClosingDetails.StoreCode);
                                    objPartnerGMDetailsnew.ToPartnerCode           = Convert.ToString("");
                                    objPartnerGMDetailsnew.ToPartnerEmployeeCode   = Convert.ToString("");
                                    objPartnerGMDetailsnew.ToPlantCode             = "";
                                    objPartnerGMDetailsnew.ToStoreCode             = Convert.ToString("");
                                    objPartnerGMDetailsnew.ToMaterialCode          = Convert.ToString("");
                                }
                            }
                            objPartnerGMCol.colPartnerGMDetail.Add(objPartnerGMDetailsnew);

                            /*Partner Goods Movement Serial Detail*/

                            PartnerGoodsMovSerialDetail objPartnerGoodsMovSerialnew = new PartnerGoodsMovSerialDetail();
                            objPartnerGoodsMovSerialnew.PGoodsMovementCode = strGoodsMovementCode;
                            objPartnerGoodsMovSerialnew.ItemNo             = tmpItemNo;
                            objPartnerGoodsMovSerialnew.SerialNo1          = Convert.ToString(argCallClosingDetails.SerialNo1);
                            objPartnerGoodsMovSerialnew.SerialNo2          = Convert.ToString(argCallClosingDetails.SerialNo2);
                            objPartnerGoodsMovSerialnew.MaterialCode       = Convert.ToString(argCallClosingDetails.MaterialCode);
                            objPartnerGoodsMovSerialnew.MatGroup1Code      = Convert.ToString(argCallClosingDetails.MatGroup1Code);
                            objPartnerGoodsMovSerialnew.RefDocCode         = Convert.ToString(argCallClosingDetails.CallCode);
                            objPartnerGoodsMovSerialnew.RefDocItemNo       = Convert.ToInt32(argCallClosingDetails.CallItemNo);
                            objPartnerGoodsMovSerialnew.RefDocType         = Convert.ToString("");
                            objPartnerGoodsMovSerialnew.TranRefDocCode     = Convert.ToString(argCallClosingDetails.CallClosingCode);
                            objPartnerGoodsMovSerialnew.TranRefDocItemNo   = Convert.ToInt32(ictr);
                            objPartnerGoodsMovSerialnew.IsDeleted          = 0;
                            objPartnerGoodsMovSerialnew.ClientCode         = Convert.ToString(argCallClosingDetails.ClientCode);
                            objPartnerGoodsMovSerialnew.CreatedBy          = Convert.ToString(argCallClosingDetails.CreatedBy);
                            objPartnerGoodsMovSerialnew.ModifiedBy         = Convert.ToString(argCallClosingDetails.ModifiedBy);
                            objPartnerGoodsMovSerialnew.StockIndicator     = Convert.ToString(argCallClosingDetails.StockIndicator);
                            objPartnerGoodsMovSerialnew.ToStockIndicator   = Convert.ToString(argCallClosingDetails.StockIndicator);

                            if (dsMatDocType != null)
                            {
                                if (dsMatDocType.Tables[0].Rows.Count > 0)
                                {
                                    if (dsMatDocType.Tables[0].Rows[0]["FromPlant"].ToString() != "Hide")
                                    {
                                        objPartnerGoodsMovSerialnew.PlantCode = "";
                                    }
                                    else
                                    {
                                        objPartnerGoodsMovSerialnew.PlantCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["FromPartner"].ToString() != "Hide")
                                    {
                                        objPartnerGoodsMovSerialnew.PartnerCode = Convert.ToString(argCallClosingDetails.PartnerCode);
                                    }
                                    else
                                    {
                                        objPartnerGoodsMovSerialnew.PartnerCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["FromStore"].ToString() != "Hide")
                                    {
                                        objPartnerGoodsMovSerialnew.StoreCode = Convert.ToString(argCallClosingDetails.StoreCode);
                                    }
                                    else
                                    {
                                        objPartnerGoodsMovSerialnew.StoreCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["FromEmployee"].ToString() != "Hide")
                                    {
                                        objPartnerGoodsMovSerialnew.PartnerEmployeeCode = "";
                                    }
                                    else
                                    {
                                        objPartnerGoodsMovSerialnew.PartnerEmployeeCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToPartner"].ToString() != "Hide")
                                    {
                                        objPartnerGoodsMovSerialnew.ToPartnerCode = Convert.ToString("");
                                    }
                                    else
                                    {
                                        objPartnerGoodsMovSerialnew.ToPartnerCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToStore"].ToString() != "Hide")
                                    {
                                        objPartnerGoodsMovSerialnew.ToStoreCode = Convert.ToString("");
                                    }
                                    else
                                    {
                                        objPartnerGoodsMovSerialnew.ToStoreCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToEmployee"].ToString() != "Hide")
                                    {
                                        objPartnerGoodsMovSerialnew.ToPartnerEmployeeCode = Convert.ToString("");
                                    }
                                    else
                                    {
                                        objPartnerGoodsMovSerialnew.ToPartnerEmployeeCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToPlant"].ToString() != "Hide")
                                    {
                                        objPartnerGoodsMovSerialnew.ToPlantCode = "";
                                    }
                                    else
                                    {
                                        objPartnerGoodsMovSerialnew.ToPlantCode = "";
                                    }

                                    if (dsMatDocType.Tables[0].Rows[0]["ToMaterialCode"].ToString() != "Hide")
                                    {
                                        objPartnerGoodsMovSerialnew.ToMaterialCode = Convert.ToString("");
                                    }
                                    else
                                    {
                                        objPartnerGoodsMovSerialnew.ToMaterialCode = "";
                                    }
                                }
                                else
                                {
                                    objPartnerGoodsMovSerialnew.PlantCode             = "";
                                    objPartnerGoodsMovSerialnew.PartnerCode           = Convert.ToString(argCallClosingDetails.PartnerCode);
                                    objPartnerGoodsMovSerialnew.PartnerEmployeeCode   = "";
                                    objPartnerGoodsMovSerialnew.StoreCode             = Convert.ToString(argCallClosingDetails.StoreCode);
                                    objPartnerGoodsMovSerialnew.ToPartnerCode         = Convert.ToString("");
                                    objPartnerGoodsMovSerialnew.ToPartnerEmployeeCode = Convert.ToString("");
                                    objPartnerGoodsMovSerialnew.ToPlantCode           = "";
                                    objPartnerGoodsMovSerialnew.ToStoreCode           = Convert.ToString("");
                                    objPartnerGoodsMovSerialnew.ToMaterialCode        = Convert.ToString("");
                                }
                            }

                            objPartnerGMSerialCol.colPartnerGMSerialDetail.Add(objPartnerGoodsMovSerialnew);

                            /*----------------------------------------------------------------------------------------------------------*/
                        }
                    }
                }
                /*Partner Goods Movement Save*/
                objPartnerGMManager.SavePartnerGoodsMovement(objPartnerGM, objPartnerGMCol, objPartnerGMSerialCol, da, lstErr);

                foreach (ErrorHandler objerr in lstErr)
                {
                    if (objerr.Type == "E")
                    {
                        errorcol.colErrorHandler.Add(objerr);
                        da.ROLLBACK_TRANSACTION();
                        return(errorcol);
                    }

                    if (objerr.Type == "A")
                    {
                        errorcol.colErrorHandler.Add(objerr);
                        da.ROLLBACK_TRANSACTION();
                        return(errorcol);
                    }
                }

                da.COMMIT_TRANSACTION();
            }
            catch (Exception ex)
            {
                if (da != null)
                {
                    da.ROLLBACK_TRANSACTION();
                }
                objErrorHandler.Type       = ErrorConstant.strAboartType;
                objErrorHandler.MsgId      = 0;
                objErrorHandler.Module     = ErrorConstant.strInsertModule;
                objErrorHandler.ModulePart = ErrorConstant.strMasterModule;
                objErrorHandler.Message    = ex.Message.ToString();
                objErrorHandler.RowNo      = 0;
                objErrorHandler.FieldName  = "";
                objErrorHandler.LogCode    = "";
                lstErr.Add(objErrorHandler);
                errorcol.colErrorHandler.Add(objErrorHandler);
            }
            finally
            {
                if (da != null)
                {
                    da.Close_Connection();
                    da = null;
                }
            }
            return(errorcol);
        }