Exemple #1
0
 public void SaveCallClosingMaster(CallClosingMaster argCallClosingMaster, DataAccess da, List <ErrorHandler> lstErr)
 {
     try
     {
         if (blnIsCallClosingMasterExists(argCallClosingMaster.CallClosingCode, argCallClosingMaster.CallCode, argCallClosingMaster.ClientCode, da) == false)
         {
             InsertCallClosingMaster(argCallClosingMaster, da, lstErr);
         }
         else
         {
             UpdateCallClosingMaster(argCallClosingMaster, da, lstErr);
         }
     }
     catch (Exception ex)
     {
         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);
     }
 }
Exemple #2
0
        private CallClosingMaster objCreateCallClosingMaster(DataRow dr)
        {
            CallClosingMaster tCallClosingMaster = new CallClosingMaster();

            tCallClosingMaster.SetObjectInfo(dr);

            return(tCallClosingMaster);
        }
Exemple #3
0
        public void InsertCallClosingMaster(CallClosingMaster argCallClosingMaster, DataAccess da, List <ErrorHandler> lstErr)
        {
            SqlParameter[] param = new SqlParameter[13];

            param[0] = new SqlParameter("@CallClosingCode", argCallClosingMaster.CallClosingCode);
            param[1] = new SqlParameter("@CallClosingDocTypeCode", argCallClosingMaster.CallClosingDocTypeCode);
            param[2] = new SqlParameter("@CallCode", argCallClosingMaster.CallCode);
            param[3] = new SqlParameter("@CallClosingDate", argCallClosingMaster.CallClosingDate);
            param[4] = new SqlParameter("@NetPayable", argCallClosingMaster.NetPayable);
            param[5] = new SqlParameter("@PaidAmt", argCallClosingMaster.PaidAmt);
            param[6] = new SqlParameter("@PartnerCode", argCallClosingMaster.PartnerCode);
            param[7] = new SqlParameter("@ClientCode", argCallClosingMaster.ClientCode);
            param[8] = new SqlParameter("@CreatedBy", argCallClosingMaster.CreatedBy);
            param[9] = new SqlParameter("@ModifiedBy", argCallClosingMaster.ModifiedBy);

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

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

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

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

            string strMessage  = Convert.ToString(param[11].Value);
            string strType     = Convert.ToString(param[10].Value);
            string strRetValue = Convert.ToString(param[12].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);
        }
Exemple #4
0
        public CallClosingMaster objGetCallClosingMaster(string argCallClosingCode, string argCallCode, string argClientCode)
        {
            CallClosingMaster argCallClosingMaster = new CallClosingMaster();
            DataSet           DataSetToFill        = new DataSet();

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

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

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

            DataSetToFill = this.GetCallClosingMaster(argCallClosingCode, argCallCode, argClientCode);

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

            argCallClosingMaster = this.objCreateCallClosingMaster((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;


            return(argCallClosingMaster);
        }
Exemple #5
0
        public ICollection <CallClosingMaster> colGetCallClosingMaster(string argCallCode, string argClientCode)
        {
            List <CallClosingMaster> lst         = new List <CallClosingMaster>();
            DataSet           DataSetToFill      = new DataSet();
            CallClosingMaster tCallClosingMaster = new CallClosingMaster();

            DataSetToFill = this.GetCallClosingMaster(argCallCode, argClientCode);

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

Finish:
            DataSetToFill = null;


            return(lst);
        }
Exemple #6
0
        public ICollection <ErrorHandler> SaveCallClosingMaster(CallClosingMaster argCallClosingMaster)
        {
            List <ErrorHandler> lstErr = new List <ErrorHandler>();
            DataAccess          da     = new DataAccess();

            try
            {
                if (blnIsCallClosingMasterExists(argCallClosingMaster.CallClosingCode, argCallClosingMaster.CallCode, argCallClosingMaster.ClientCode) == false)
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    InsertCallClosingMaster(argCallClosingMaster, da, lstErr);
                    foreach (ErrorHandler objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                }
                else
                {
                    da.Open_Connection();
                    da.BEGIN_TRANSACTION();
                    UpdateCallClosingMaster(argCallClosingMaster, 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);
        }