public bool Put(NewTicketEntity entity)
        {
            ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
            List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();

            sqlParameters.Add(new KeyValuePair <string, string>("@TicketID", (entity.ticket_id).ToString()));
            sqlParameters.Add(new KeyValuePair <string, string>("@assingedTo", (entity.assingedTo).ToString()));
            sqlParameters.Add(new KeyValuePair <string, string>("@Ticketstatus", entity.Ticketstatus));
            sqlParameters.Add(new KeyValuePair <string, string>("@short_desc", entity.short_desc));
            // sqlParameters.Add(new KeyValuePair<string, string>("@URL", entity.URL));
            sqlParameters.Add(new KeyValuePair <string, string>("@StatusCode", (entity.StatusCode).ToString()));
            sqlParameters.Add(new KeyValuePair <string, string>("@CC", entity.CC));
            var result = manageSQLConnection.UpdateValues("UpdateTickets", sqlParameters);

            MailSending mailSending = new MailSending();
            //Mail sending
            MailEntity mailEntity = new MailEntity
            {
                FromMailid   = GlobalVariables.FromMailid,
                FromPassword = GlobalVariables.Password,
                ToMailid     = entity.assingedTo,
                ToCC         = entity.bodyMessage.TOCC,
                Port         = GlobalVariables.Port,
                Subject      = entity.short_desc,
                BodyMessage  = mailSending.BodyMessage(entity.bodyMessage, entity.ticket_id),
                SMTP         = GlobalVariables.Host
            };

            mailSending.Send(mailEntity);

            return(result);
        }
Beispiel #2
0
        public GToGEntity Post(GToGParameter gtog)
        {
            bool   isUpdated = false;
            string details   = JsonConvert.SerializeObject(gtog);

            AuditLog.WriteError(details);
            if (!string.IsNullOrEmpty(gtog.IssueMemoNumber))
            {
                ManageGtoG manageGtoG = new ManageGtoG();
                //Check issuememo number
                var result = manageGtoG.CheckIssueMemoNumber(gtog.IssueMemoNumber);
                if (result.Item1)
                {
                    ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
                    List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                    sqlParameters.Add(new KeyValuePair <string, string>("@DocNumber", gtog.IssueMemoNumber));
                    isUpdated = manageSQLConnection.UpdateValues("UpdateGToGAck", sqlParameters);
                    return(GetMessage(gtog.IssueMemoNumber, isUpdated));
                }
                else
                {
                    return(result.Item2);
                }
            }
            return(GetNullIssuememo(gtog.IssueMemoNumber));
        }
Beispiel #3
0
        public GToGEntity Get(string IssueMemoNumber)
        {
            bool isUpdated = false;

            if (!string.IsNullOrEmpty(IssueMemoNumber))
            {
                ManageGtoG manageGtoG = new ManageGtoG();
                AuditLog.WriteError("IssueMemoNumber is : " + IssueMemoNumber);
                //Check issuememo number
                var result = manageGtoG.CheckIssueMemoNumber(IssueMemoNumber);
                if (result.Item1)
                {
                    ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
                    List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                    sqlParameters.Add(new KeyValuePair <string, string>("@DocNumber", IssueMemoNumber));
                    isUpdated = manageSQLConnection.UpdateValues("UpdateGToGAck", sqlParameters);
                    return(GetMessage(IssueMemoNumber, isUpdated));
                }
                else
                {
                    return(result.Item2);
                }
            }
            else
            {
                AuditLog.WriteError("IssueMemoNumber is : " + IssueMemoNumber);
            }

            return(GetNullIssuememo(IssueMemoNumber));
        }
Beispiel #4
0
        public bool Put(PrintEntity entity)
        {
            ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
            List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();

            sqlParameters.Add(new KeyValuePair <string, string>("@SRNo", entity.DOCNumber));
            return(manageSQLConnection.UpdateValues("UpdateSRDetailsUnLoading", sqlParameters));
        }
        public bool Put(PrintEntity entity)
        {
            ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
            List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();

            sqlParameters.Add(new KeyValuePair <string, string>("@STNo", entity.DOCNumber));
            return(manageSQLConnection.UpdateValues("UpdateStockTransferIssueslip", sqlParameters));
        }
Beispiel #6
0
        public bool Put(WriteOffEntity writeOffEntity)
        {
            ManageSQLConnection manageSQLConnection = new ManageSQLConnection();
            List <KeyValuePair <string, string> > listParameters = new List <KeyValuePair <string, string> >();

            listParameters.Add(new KeyValuePair <string, string>("@Rowid", writeOffEntity.Rowid));
            listParameters.Add(new KeyValuePair <string, string>("@WriteOff", writeOffEntity.WriteOff));
            return(manageSQLConnection.UpdateValues("UpdateOpeningBalanceMaster", listParameters));
        }
Beispiel #7
0
        public bool Put(NMSEntity entity)
        {
            ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
            List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();

            sqlParameters.Add(new KeyValuePair <string, string>("@ID", (entity.ID).ToString()));
            sqlParameters.Add(new KeyValuePair <string, string>("@ClosedDate", entity.ClosedDate));
            return(manageSQLConnection.UpdateValues("UpdateNMSData", sqlParameters));
        }
Beispiel #8
0
        public bool Put(StackCardEntity stackCardEntity)
        {
            DataSet             ds = new DataSet();
            ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
            List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();

            sqlParameters.Add(new KeyValuePair <string, string>("@RowId", stackCardEntity.RowId));
            sqlParameters.Add(new KeyValuePair <string, string>("@ClosedDate", stackCardEntity.ClosedDate));
            return(manageSQLConnection.UpdateValues("UpdateStackDetails", sqlParameters));
        }
Beispiel #9
0
        public bool Delete(string RowId, string GCode)
        {
            ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
            List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();

            sqlParameters.Add(new KeyValuePair <string, string>("@GodownCode", GCode));
            sqlParameters.Add(new KeyValuePair <string, string>("@RowId", RowId));
            return(manageSQLConnection.UpdateValues("DeleteStackDetails", sqlParameters));
            //Calculate the
        }
Beispiel #10
0
        public bool Put(SocietyMasterEntryIssuerEntity societyMasterEntry)
        {
            // DataSet ds = new DataSet();
            ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
            List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();

            sqlParameters.Add(new KeyValuePair <string, string>("@soccode", societyMasterEntry.SCode));
            sqlParameters.Add(new KeyValuePair <string, string>("@icode", societyMasterEntry.ICode));
            sqlParameters.Add(new KeyValuePair <string, string>("@itype", societyMasterEntry.IType));
            sqlParameters.Add(new KeyValuePair <string, string>("@gcode", societyMasterEntry.GCode));
            return(manageSQLConnection.UpdateValues("update_societymasterentry", sqlParameters));
        }
Beispiel #11
0
        public Tuple <bool, string, string> Post(DocumentStockReceiptList stockReceipt = null)
        {
            ManageDocumentReceipt documentReceipt = new ManageDocumentReceipt();

            if (stockReceipt.Type == 2)
            {
                ManageSQLConnection manageSQLConnection = new ManageSQLConnection();
                documentReceipt.GenerateReceipt(stockReceipt);
                //update print
                if (stockReceipt.UnLoadingSlip == "N" || string.IsNullOrEmpty(stockReceipt.UnLoadingSlip))
                {
                    List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                    sqlParameters.Add(new KeyValuePair <string, string>("@SRNo", stockReceipt.SRNo));
                    manageSQLConnection.UpdateValues("UpdateSRDetailsUnLoading", sqlParameters);
                }
                return(new Tuple <bool, string, string>(true, "Print Generated Sucessfully", ""));
            }
            else
            {
                ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
                List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                sqlParameters.Add(new KeyValuePair <string, string>("@GCode", stockReceipt.ReceivingCode));
                var          result       = manageSQLConnection.GetDataSetValues("AllowDocumentEntry", sqlParameters);
                ManageReport manageReport = new ManageReport();
                if (manageReport.CheckDataAvailable(result))
                {
                    if (stockReceipt.SRNo.Trim() != "0" && stockReceipt.SRNo.Trim() != "-")
                    {
                        List <KeyValuePair <string, string> > sqlParameters1 = new List <KeyValuePair <string, string> >();
                        sqlParameters1.Add(new KeyValuePair <string, string>("@Type", "1"));
                        sqlParameters1.Add(new KeyValuePair <string, string>("@DocNumber", stockReceipt.SRNo.Trim()));
                        var result1 = manageSQLConnection.GetDataSetValues("CheckDocumentEdit", sqlParameters1);
                        if (!manageReport.CheckDataAvailable(result1))
                        {
                            return(new Tuple <bool, string, string>(false, GlobalVariable.DocumentEditPermission, ""));
                        }
                        // CheckDocumentEdit
                    }
                    else if (documentReceipt.CheckSRUpdateStatus(stockReceipt.SRNo))
                    {
                        return(new Tuple <bool, string, string>(false, GlobalVariable.DocumentEditByHO, ""));
                    }
                    StockReceipt receipt = new StockReceipt();
                    return(receipt.InsertReceiptData(stockReceipt));
                }
                else
                {
                    return(new Tuple <bool, string, string>(false, "Permission not Granted", ""));
                }
            }
        }
        public Tuple <bool, string> Post(DocumentStockReceiptList stockReceipt = null)
        {
            //Check valid user details.
            ManageSQLConnection manageSQLConnection = new ManageSQLConnection();
            ManageReport        manage = new ManageReport();
            List <KeyValuePair <string, string> > sqlParameters1 = new List <KeyValuePair <string, string> >();

            sqlParameters1.Add(new KeyValuePair <string, string>("@UserName", stockReceipt.UserID));
            DataSet ds = new DataSet();

            ds = manageSQLConnection.GetDataSetValues("GetDocumentDownloadUser", sqlParameters1);
            if (manage.CheckDataAvailable(ds))
            {
                ManagePDFGeneration managePDF = new ManagePDFGeneration();
                var result = managePDF.GeneratePDF(stockReceipt);
                if (result.Item1)
                {
                    List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                    sqlParameters.Add(new KeyValuePair <string, string>("@Doc", stockReceipt.SRNo));
                    sqlParameters.Add(new KeyValuePair <string, string>("@Status", "1"));
                    manageSQLConnection.UpdateValues("UpdateSRDetailStatus", sqlParameters);

                    List <KeyValuePair <string, string> > InsertParameter = new List <KeyValuePair <string, string> >();
                    InsertParameter.Add(new KeyValuePair <string, string>("@GCode", stockReceipt.ReceivingCode));
                    InsertParameter.Add(new KeyValuePair <string, string>("@RCode", stockReceipt.RCode));
                    InsertParameter.Add(new KeyValuePair <string, string>("@DocNumber", stockReceipt.SRNo));
                    InsertParameter.Add(new KeyValuePair <string, string>("@UserName", stockReceipt.UserID));
                    InsertParameter.Add(new KeyValuePair <string, string>("@DocType", "1"));
                    manageSQLConnection.InsertData("InsertDocumentDownloadLog", InsertParameter);
                }
                return(result);
            }
            else
            {
                List <KeyValuePair <string, string> > InsertParameter = new List <KeyValuePair <string, string> >();
                InsertParameter.Add(new KeyValuePair <string, string>("@GCode", stockReceipt.ReceivingCode));
                InsertParameter.Add(new KeyValuePair <string, string>("@RCode", stockReceipt.RCode));
                InsertParameter.Add(new KeyValuePair <string, string>("@DocNumber", stockReceipt.SRNo));
                InsertParameter.Add(new KeyValuePair <string, string>("@UserName", stockReceipt.UserID));
                InsertParameter.Add(new KeyValuePair <string, string>("@DocType", "2"));
                manageSQLConnection.InsertData("InsertDocumentDownloadLog", InsertParameter);
                //
                return(new Tuple <bool, string>(false, "Please contact HO"));
            }
        }
 public Tuple <bool, string, string> Post(DocumentStockTransferDetails documentStockTransfer = null)
 {
     if (documentStockTransfer.Type == 2)
     {
         ManageDocumentTruckMemo documentTruckMemo = new ManageDocumentTruckMemo();
         documentTruckMemo.GenerateTruckMemo(documentStockTransfer);
         if (documentStockTransfer.IssueSlip == "N" || string.IsNullOrEmpty(documentStockTransfer.IssueSlip))
         {
             ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
             List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
             sqlParameters.Add(new KeyValuePair <string, string>("@STNo", documentStockTransfer.STNo));
             manageSQLConnection.UpdateValues("UpdateStockTransferIssueslip", sqlParameters);
         }
         return(new Tuple <bool, string, string>(true, "Print Generated Successfully", documentStockTransfer.STNo));
     }
     else
     {
         ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
         List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
         sqlParameters.Add(new KeyValuePair <string, string>("@GCode", documentStockTransfer.IssuingCode));
         var          result       = manageSQLConnection.GetDataSetValues("AllowDocumentEntry", sqlParameters);
         ManageReport manageReport = new ManageReport();
         if (manageReport.CheckDataAvailable(result))
         {
             if (documentStockTransfer.STNo.Trim() != "0" && documentStockTransfer.STNo.Trim() != "-")
             {
                 List <KeyValuePair <string, string> > sqlParameters1 = new List <KeyValuePair <string, string> >();
                 sqlParameters1.Add(new KeyValuePair <string, string>("@Type", "3"));
                 sqlParameters1.Add(new KeyValuePair <string, string>("@DocNumber", documentStockTransfer.STNo.Trim()));
                 var result1 = manageSQLConnection.GetDataSetValues("CheckDocumentEdit", sqlParameters1);
                 if (!manageReport.CheckDataAvailable(result1))
                 {
                     return(new Tuple <bool, string, string>(false, GlobalVariable.DocumentEditPermission, ""));
                 }
                 // CheckDocumentEdit
             }
             ManageTruckMemo manageTruck = new ManageTruckMemo();
             return(manageTruck.InsertTruckMemoEntry(documentStockTransfer));
         }
         else
         {
             return(new Tuple <bool, string, string>(false, "Permission not Granted", ""));
         }
     }
 }
Beispiel #14
0
        public bool Post(UserDetails userDetails)
        {
            ManageSQLConnection manageSQLConnection = new ManageSQLConnection();
            DataSet             ds = new DataSet();
            List <KeyValuePair <string, string> > parameterList = new List <KeyValuePair <string, string> >();

            try
            {
                parameterList.Add(new KeyValuePair <string, string>("@UserName", userDetails.UserId));
                parameterList.Add(new KeyValuePair <string, string>("@OldPassword", userDetails.OldPassword));
                parameterList.Add(new KeyValuePair <string, string>("@NewPassword", userDetails.NewPassword));
                return(manageSQLConnection.UpdateValues("UpdatePassword", parameterList));
            }
            finally
            {
                ds.Dispose();
                parameterList = null;
            }
        }
        public bool Put(GatePassCommonEntity entity)
        {
            ManageSQLConnection manageSQLConnection = new ManageSQLConnection();

            if (entity.Type == 1)
            {
                DataSet ds = new DataSet();
                List <KeyValuePair <string, string> > sqlParameters1 = new List <KeyValuePair <string, string> >();
                sqlParameters1.Add(new KeyValuePair <string, string>("@DocumentId", entity.DocNumber));
                ds = manageSQLConnection.GetDataSetValues("GetStockIssuesForAbstractPrint", sqlParameters1);
                ManageIssuesAbstractPrint issuesAbstractPrint = new ManageIssuesAbstractPrint();
                Task.Run(() => issuesAbstractPrint.ProcessDataToGPS(ds, entity));
            }
            List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();

            sqlParameters.Add(new KeyValuePair <string, string>("@GatePassId", entity.GatePassNo));
            sqlParameters.Add(new KeyValuePair <string, string>("@GCode", entity.GCode));
            return(manageSQLConnection.UpdateValues("UpdateGatePass", sqlParameters));
        }
        public Tuple <bool, string> Post(DocCorrectionEntity docCorrectionEntity = null)
        {
            ManageSQLConnection manageSQLConnection = new ManageSQLConnection();

            if (docCorrectionEntity.Type == 1)
            {
                List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                sqlParameters.Add(new KeyValuePair <string, string>("@DocNumber", docCorrectionEntity.DocNo));
                sqlParameters.Add(new KeyValuePair <string, string>("@RoleId", docCorrectionEntity.RoleId.ToString()));
                sqlParameters.Add(new KeyValuePair <string, string>("@DocType", docCorrectionEntity.DocType.ToString()));
                sqlParameters.Add(new KeyValuePair <string, string>("@RegionCode", docCorrectionEntity.RCode));
                sqlParameters.Add(new KeyValuePair <string, string>("@GodownCode", docCorrectionEntity.GCode));
                sqlParameters.Add(new KeyValuePair <string, string>("@Reason", docCorrectionEntity.Reason));
                var result = manageSQLConnection.InsertData("InsertDocumentCorrection", sqlParameters);
                if (result)
                {
                    return(new Tuple <bool, string>(true, "Request sent!"));
                }
                else
                {
                    return(new Tuple <bool, string>(false, "Please contact Administrator"));
                }
            }
            else
            {
                List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                sqlParameters.Add(new KeyValuePair <string, string>("@Id", docCorrectionEntity.Id.ToString()));
                sqlParameters.Add(new KeyValuePair <string, string>("@ApproverRoleID", docCorrectionEntity.ApproverRoleID.ToString()));
                sqlParameters.Add(new KeyValuePair <string, string>("@ApproverReason", docCorrectionEntity.ApproverReason.ToString()));
                sqlParameters.Add(new KeyValuePair <string, string>("@ApprovalStatus", docCorrectionEntity.ApprovalStatus.ToString()));
                var result = manageSQLConnection.UpdateValues("UpdateDocumentCorrection", sqlParameters);
                if (result)
                {
                    return(new Tuple <bool, string>(true, docCorrectionEntity.ApprovalStatus == 1 ? "Approved!" : "Rejected!"));
                }
                else
                {
                    return(new Tuple <bool, string>(false, "Please contact Administrator"));
                }
            }
            // return new Tuple<bool, string>(false, "Please contact Administrator");
        }
        public bool Put(SrEntity srEntity)
        {
            ManageSQLConnection manageSQLConnection = new ManageSQLConnection();
            ManageReport        manage = new ManageReport();
            List <KeyValuePair <string, string> > sqlParameters1 = new List <KeyValuePair <string, string> >();

            sqlParameters1.Add(new KeyValuePair <string, string>("@UserName", srEntity.UserId));
            DataSet ds = new DataSet();

            ds = manageSQLConnection.GetDataSetValues("GetDocumentDownloadUser", sqlParameters1);
            if (manage.CheckDataAvailable(ds))
            {
                List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                sqlParameters.Add(new KeyValuePair <string, string>("@Doc", srEntity.DocNumber));
                sqlParameters.Add(new KeyValuePair <string, string>("@Status", srEntity.Status.ToString()));
                return(manageSQLConnection.UpdateValues("UpdateSRDetailStatus", sqlParameters));
            }
            else
            {
                return(false);
            }
        }
 public bool Put(IssuerEntity issuerEntity)
 {
     if (issuerEntity.Type == 1)
     {
         ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
         List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
         sqlParameters.Add(new KeyValuePair <string, string>("@IssuerCode", issuerEntity.IssuerCode));
         sqlParameters.Add(new KeyValuePair <string, string>("@PartyID", issuerEntity.PartyID));
         sqlParameters.Add(new KeyValuePair <string, string>("@IssuerNo", issuerEntity.IssuerNo));
         sqlParameters.Add(new KeyValuePair <string, string>("@GSTNumber", issuerEntity.GSTNumber));
         sqlParameters.Add(new KeyValuePair <string, string>("@RCode", issuerEntity.RCode));
         return(manageSQLConnection.UpdateValues("UpdateIssuerPartyMaster", sqlParameters));
     }
     else
     {
         ManageSQLConnection manageSQLConnection             = new ManageSQLConnection();
         List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
         sqlParameters.Add(new KeyValuePair <string, string>("@IssuerCode", issuerEntity.IssuerCode));
         sqlParameters.Add(new KeyValuePair <string, string>("@Activeflag", issuerEntity.Activeflag));
         sqlParameters.Add(new KeyValuePair <string, string>("@ACSCode", issuerEntity.ACSCode));
         sqlParameters.Add(new KeyValuePair <string, string>("@Godcode", issuerEntity.GCode));
         return(manageSQLConnection.UpdateValues("UpdateIssuerMaster", sqlParameters));
     }
 }
        public Tuple <bool, string, string> Post(DocumentStockIssuesEntity documentStockIssuesEntity = null)
        {
            ManageSQLConnection manageSQLConnection = new ManageSQLConnection();
            ManageReport        manageReport        = new ManageReport();
            //Check the document Approval
            List <KeyValuePair <string, string> > sqlParametersDocApproval = new List <KeyValuePair <string, string> >();

            sqlParametersDocApproval.Add(new KeyValuePair <string, string>("@DocDate", documentStockIssuesEntity.SIDate));
            sqlParametersDocApproval.Add(new KeyValuePair <string, string>("@GCode", documentStockIssuesEntity.IssuingCode));
            var docResult = manageSQLConnection.GetDataSetValues("GetApprovalStatusForDocument", sqlParametersDocApproval);

            if (manageReport.CheckDocApproval(docResult))
            {
                if (documentStockIssuesEntity.Type == 2)
                {
                    ManageDocumentIssues documentIssues = new ManageDocumentIssues();
                    documentIssues.GenerateIssues(documentStockIssuesEntity);
                    if (documentStockIssuesEntity.Loadingslip == "N" || string.IsNullOrEmpty(documentStockIssuesEntity.Loadingslip))
                    {
                        List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                        sqlParameters.Add(new KeyValuePair <string, string>("@SINo", documentStockIssuesEntity.SINo));
                        manageSQLConnection.UpdateValues("UpdateStockIssuesLoadingslip", sqlParameters);
                    }
                    return(new Tuple <bool, string, string>(true, "Print Generated Successfully", documentStockIssuesEntity.SINo));
                }
                else
                {
                    List <KeyValuePair <string, string> > sqlParameters = new List <KeyValuePair <string, string> >();
                    sqlParameters.Add(new KeyValuePair <string, string>("@GCode", documentStockIssuesEntity.IssuingCode));
                    var result = manageSQLConnection.GetDataSetValues("AllowDocumentEntry", sqlParameters);
                    if (manageReport.CheckDataAvailable(result))
                    {
                        if (documentStockIssuesEntity.DocType == 2) //(documentStockIssuesEntity.SINo.Trim() != "0" && documentStockIssuesEntity.SINo.Trim() != "-")
                        {
                            List <KeyValuePair <string, string> > sqlParameters1 = new List <KeyValuePair <string, string> >();
                            sqlParameters1.Add(new KeyValuePair <string, string>("@Type", "2"));
                            sqlParameters1.Add(new KeyValuePair <string, string>("@DocNumber", documentStockIssuesEntity.SINo.Trim()));
                            var result1 = manageSQLConnection.GetDataSetValues("CheckDocumentEdit", sqlParameters1);
                            if (!manageReport.CheckDataAvailable(result1))
                            {
                                return(new Tuple <bool, string, string>(false, GlobalVariable.DocumentEditPermission, ""));
                            }
                            // CheckDocumentEdit
                        }
                        else
                        {
                            // check document available
                            List <KeyValuePair <string, string> > sqlParameterscheckdate = new List <KeyValuePair <string, string> >();
                            sqlParameterscheckdate.Add(new KeyValuePair <string, string>("@SINo", documentStockIssuesEntity.SINo));
                            var result1 = manageSQLConnection.GetDataSetValues("GetStockIssueDetailsBySINo", sqlParameterscheckdate);
                            if (manageReport.CheckDataAvailable(result1))
                            {
                                return(new Tuple <bool, string, string>(false, "This document number " + documentStockIssuesEntity.SINo + " is already exists, Please refresh the page.", ""));
                            }
                        }
                        StockIssueMemo stockIssueMemo = new StockIssueMemo();
                        return(stockIssueMemo.InsertStockIssueData(documentStockIssuesEntity));
                    }
                    else
                    {
                        return(new Tuple <bool, string, string>(false, "Permission not Granted", ""));
                    }
                }
            }
            else
            {
                return(new Tuple <bool, string, string>(false, "Please Approve CB, Receipt, Issues and Truck memo for yesterday documents. If you wants to do without approval Please get permission from HO (MD).", ""));
            }
        }