Exemple #1
0
        protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            CustomProfile            profile  = CustomProfile.GetProfile();
            iUC_AttachDocumentClient Document = new iUC_AttachDocumentClient();
            mDocumentType            DocType  = new mDocumentType();

            if (hdnstate.Value == "Edit")
            {
                DocType = Document.GetDocumentTypebyID(long.Parse(hdndocumenttypeID.Value), profile.DBConnection._constr);
            }
            DocType.DocumentType = txtdoctype.Text;
            DocType.Sequence     = int.Parse(txtSequence.Text);
            DocType.Description  = txtDescription.Text;
            DocType.CompanyID    = long.Parse(ddlcompany.SelectedItem.Value);
            DocType.CustomerID   = long.Parse(hdncustomerid.Value);
            DocType.CreatedBy    = profile.Personal.UserID;
            DocType.CreationDate = DateTime.Now;
            DocType.Active       = "Yes";
            if (rbtnNo.Checked == true)
            {
                DocType.Active = "No";
            }
            long DocTypeID = Document.SaveDocumentType(DocType, profile.DBConnection._constr);

            if (hdnstate.Value == "Edit")
            {
                WebMsgBox.MsgBox.Show("Record Updated Succefully!");
            }
            else
            {
                WebMsgBox.MsgBox.Show("Record Save Succefully!");
            }
            clear();
            BindGrid();
        }
Exemple #2
0
        public static void FinalSaveDocument1(long ReferenceID, string SessionID, string TargetObjectName)
        {
            CustomProfile            profile = CustomProfile.GetProfile();
            iUC_AttachDocumentClient DocumentSourceClient = new iUC_AttachDocumentClient();

            DocumentSourceClient.FinalSaveToDBtDocument(SessionID, ReferenceID, profile.Personal.UserID.ToString(), TargetObjectName + "Document", HttpRuntime.AppDomainAppPath.ToString(), profile.DBConnection._constr);
        }
Exemple #3
0
        public static void ClearDocument(string TargetObjectName, string SessionID)
        {
            CustomProfile profile = CustomProfile.GetProfile();

            BrilliantWMS.DocumentService.iUC_AttachDocumentClient DocumentServiceClient = new iUC_AttachDocumentClient();
            DocumentServiceClient.ClearTempData(SessionID, profile.Personal.UserID.ToString(), TargetObjectName + "Document", profile.DBConnection._constr);
            DocumentServiceClient.Close();
        }
        public void GetDocumentList()
        {
            iUC_AttachDocumentClient documentClient = new iUC_AttachDocumentClient();
            CustomProfile            profile        = CustomProfile.GetProfile();

            grddocument.DataSource = documentClient.GetDocumentList(profile.DBConnection._constr);
            grddocument.DataBind();
            documentClient.Close();
        }
Exemple #5
0
        public void ClearDocument(string TargetObjectName)
        {
            CustomProfile profile = CustomProfile.GetProfile();

            hndDocumentTargetObjectName.Value = TargetObjectName;
            BrilliantWMS.DocumentService.iUC_AttachDocumentClient DocumentServiceClient = new iUC_AttachDocumentClient();
            DocumentServiceClient.ClearTempData(Session.SessionID, profile.Personal.UserID.ToString(), TargetObjectName + "Document", profile.DBConnection._constr);
            DocumentServiceClient.Close();
            GvDocument.DataSource = null;
            GvDocument.DataBind();
        }
Exemple #6
0
        public static string PMDeleteDocument(string Sequence)
        {
            iUC_AttachDocumentClient DocumentClient = new iUC_AttachDocumentClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                DocumentClient.DeleteDocumentFormTemp(Convert.ToInt64(Sequence), sessionID, profile.Personal.UserID.ToString(), "Account", profile.DBConnection._constr);
                return("true");
            }
            catch (Exception ex) { return("false"); }
            finally { DocumentClient.Close(); }
        }
Exemple #7
0
 public void FillDocumentByObjectNameReferenceID(long ReferenceID, string SourceObjectName, string TargetObjectName)
 {
     try
     {
         CustomProfile profile = CustomProfile.GetProfile();
         hndDocumentTargetObjectName.Value = TargetObjectName;
         BrilliantWMS.DocumentService.iUC_AttachDocumentClient DocumentServiceClient = new iUC_AttachDocumentClient();
         GvDocument.DataSource = DocumentServiceClient.GetDocumentByReferenceId(SourceObjectName + "Document", TargetObjectName + "Document", ReferenceID, profile.Personal.UserID.ToString(), Session.SessionID.ToString(), profile.DBConnection._constr);
         GvDocument.DataBind();
     }
     catch (System.Exception ex)
     {
         Login.Profile.ErrorHandling(ex, "UC_AttachDocuments.ascx.cs", "FillDocumentByObjectNameReferenceID");
     }
 }
Exemple #8
0
        protected void GvDocument_OnRebind(object sender, EventArgs e)
        {
            CustomProfile profile = CustomProfile.GetProfile();

            BrilliantWMS.DocumentService.iUC_AttachDocumentClient DocumentServiceClient = new iUC_AttachDocumentClient();
            if (Session["PORRequestID"].ToString() != "0" && Session["PORRequestID"].ToString() != "Company")
            {
                long RequestID = Convert.ToInt64(Session["PORRequestID"].ToString());
                FillDocumentByObjectNameReferenceID(RequestID, "RequestPartDetail", "RequestPartDetail");
            }
            else
            {
                GvDocument.DataSource = DocumentServiceClient.GetExistingTempDataBySessionIDObjectNameToRebind(Session.SessionID, profile.Personal.UserID.ToString(), hndDocumentTargetObjectName.Value + "Document", profile.DBConnection._constr);
                GvDocument.DataBind();
            }
            DocumentServiceClient.Close();
        }
Exemple #9
0
        protected void GetDocumentTypeByID(long DocTypeID)
        {
            CustomProfile            profile  = CustomProfile.GetProfile();
            iUC_AttachDocumentClient Document = new iUC_AttachDocumentClient();
            mDocumentType            DocType  = new mDocumentType();

            DocType = Document.GetDocumentTypebyID(long.Parse(hdndocumenttypeID.Value), profile.DBConnection._constr);
            FillCompany();
            if (DocType.CompanyID != null)
            {
                ddlcompany.SelectedIndex = ddlcompany.Items.IndexOf(ddlcompany.Items.FindByValue(DocType.CompanyID.ToString()));
            }
            hdnCompanyid.Value = DocType.CompanyID.ToString();
            getCustomer(long.Parse(DocType.CompanyID.ToString()));
            if (DocType.CustomerID != null)
            {
                ddlcustomer.SelectedIndex = ddlcustomer.Items.IndexOf(ddlcustomer.Items.FindByValue(DocType.CustomerID.ToString()));
            }
            hdncustomerid.Value = DocType.CustomerID.ToString();
            if (DocType.DocumentType != null)
            {
                txtdoctype.Text = DocType.DocumentType.ToString();
            }
            if (DocType.Description != null)
            {
                txtDescription.Text = DocType.Description.ToString();
            }
            if (DocType.Sequence != null)
            {
                txtSequence.Text = DocType.Sequence.ToString();
            }
            if (DocType.Active == "No")
            {
                rbtnNo.Checked = true;
            }
            else
            {
                rbtnYes.Checked = true;
            }
        }
Exemple #10
0
        protected void upload_LinkBtn_Click(object sender, EventArgs e)
        {
            string DocumentSaveAsPath               = "";
            string DocumentDownLoadPath             = "";
            string HttpAppPath                      = HttpRuntime.AppDomainAppPath;
            iUC_AttachDocumentClient documentClient = new iUC_AttachDocumentClient();

            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                if (FileUploadDocument.PostedFile != null)
                {
                    if (profile.Personal.CompanyID.ToString() != "")
                    {
                        if (!(Directory.Exists(HttpAppPath + "Document\\TempAttach_Document\\" + profile.Personal.CompanyID.ToString())))
                        {
                            Directory.CreateDirectory(HttpAppPath + "Document\\TempAttach_Document\\" + profile.Personal.CompanyID.ToString());
                        }
                    }
                    //string FileType = FileUploadDocument.PostedFile.ContentType.Split('/').LastOrDefault();
                    string[] strArr   = FileUploadDocument.PostedFile.FileName.Split('.');
                    string   FileType = strArr[strArr.Length - 1];
                    string   FileName = Session.SessionID.ToString() + "_" + DateTime.Now.Ticks.ToString() + "." + FileType;
                    DocumentDownLoadPath = "../Document/TempAttach_Document/" + profile.Personal.CompanyID.ToString() + "/" + FileName;
                    DocumentSaveAsPath   = HttpAppPath + "Document\\TempAttach_Document\\" + profile.Personal.CompanyID.ToString() + "\\" + FileName;
                    FileUploadDocument.SaveAs(DocumentSaveAsPath);

                    /*Insert into TempData*/
                    SP_GetDocumentList_Result newDocument = new SP_GetDocumentList_Result();

                    newDocument.ObjectName   = TargetObjectName;;
                    newDocument.ReferenceID  = Convert.ToInt64(Sequence);
                    newDocument.DocumentName = null;
                    if (txtDocTitle.Text.ToString().Trim() != "")
                    {
                        newDocument.DocumentName = txtDocTitle.Text.ToString().Trim();
                    }
                    newDocument.Sequence    = Convert.ToInt32(Sequence);
                    newDocument.Description = null;
                    if (txtDocDesc.Text.ToString().Trim() != "")
                    {
                        newDocument.Description = txtDocDesc.Text.ToString().Trim();
                    }

                    newDocument.DocumentDownloadPath = DocumentDownLoadPath;
                    newDocument.DocumentSavePath     = DocumentSaveAsPath;
                    newDocument.FileType             = FileType;

                    newDocument.Keywords = null;
                    if (txtKeyword.Text.ToString().Trim() != "")
                    {
                        newDocument.Keywords = txtKeyword.Text.ToString().Trim();
                    }

                    if (rbtnPrivate.Checked == true)
                    {
                        newDocument.ViewAccess_Value    = "";
                        newDocument.DeleteAccess_Value  = hdnDeleteAccessIDs.Value;
                        newDocument.DowloadAccess_Value = hdDownLoadAccessIDs.Value;
                    }
                    else if (rbtnPublic.Checked == true)
                    {
                        newDocument.ViewAccess_Value    = "Public";
                        newDocument.DeleteAccess_Value  = "Public";
                        newDocument.DowloadAccess_Value = "Public";
                    }
                    else if (rbtnSelf.Checked == true)
                    {
                        newDocument.ViewAccess_Value = newDocument.DeleteAccess_Value = newDocument.DowloadAccess_Value = profile.Personal.UserID.ToString();
                    }

                    newDocument.Active         = "Y";
                    newDocument.CreatedBy      = profile.Personal.UserID.ToString();
                    newDocument.CreationDate   = DateTime.Now;
                    newDocument.CustomerHeadID = 0;
                    newDocument.CompanyID      = profile.Personal.CompanyID;
                    newDocument.ViewAccess     = "true";
                    newDocument.DeleteAccess   = "true";
                    newDocument.DowloadAccess  = "true";

                    newDocument.DocumentType = ddlDocumentType.SelectedValue.ToString();

                    documentClient.InsertIntoTemp(newDocument, Session.SessionID.ToString(), profile.Personal.UserID.ToString(), TargetObjectName, profile.DBConnection._constr);
                    if (Session["PORRequestID"].ToString() != "0" && Session["PORRequestID"].ToString() != "Company")
                    {
                        long RequestID = Convert.ToInt64(Session["PORRequestID"].ToString());
                        documentClient.FinalSaveToDBtDocument(Session.SessionID.ToString(), RequestID, profile.Personal.UserID.ToString(), "RequestPartDetailDocument", HttpRuntime.AppDomainAppPath.ToString(), profile.DBConnection._constr);
                    }
                    else
                    {
                        // documentClient.FinalSaveToDBtDocument(Session.SessionID.ToString(), 0, profile.Personal.UserID.ToString(), "Setup", HttpRuntime.AppDomainAppPath.ToString(), profile.DBConnection._constr);
                    }
                    ClientScript.RegisterStartupScript(GetType(), "hwa", "onSuccessTempSaveDocument('true');", true);
                }
            }
            catch (System.Exception ex)
            {
                if (DocumentSaveAsPath != "")
                {
                    if (File.Exists(DocumentSaveAsPath))
                    {
                        File.Delete(DocumentSaveAsPath);
                    }
                }
                Login.Profile.ErrorHandling(ex, this, "UC Document", "upload_LinkBtn_Click");
            }
            finally { documentClient.Close(); }
        }
        public static long WMSaveDispatchHead(object objDispatch)
        {
            long result = 0;
            int  RSLT = 0; long DispatchID = 0;

            BrilliantWMS.WMSInbound.iInboundClient   Inbound = new WMSInbound.iInboundClient();
            BrilliantWMS.WMSOutbound.iOutboundClient Outbound = new WMSOutbound.iOutboundClient();
            try
            {
                CustomProfile profile = CustomProfile.GetProfile();
                BrilliantWMS.WMSOutbound.tDispatchHead dh = new WMSOutbound.tDispatchHead();
                Dictionary <string, object>            d  = new Dictionary <string, object>();
                d = (Dictionary <string, object>)objDispatch;
                if (HttpContext.Current.Session["QCID"] != null)
                {
                    int chkJObCart = Inbound.CheckJobCard(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), "Dispatch", profile.DBConnection._constr);
                    if (chkJObCart >= 1)
                    {
                        DataSet dsJCN = new DataSet();
                        dsJCN = Outbound.CheckSelectedSOJobCardNo(Convert.ToInt64(HttpContext.Current.Session["QCID"].ToString()), "Dispatch", profile.DBConnection._constr);
                        if (dsJCN != null && dsJCN.Tables[0].Rows.Count > 0)
                        {
                            string   grpQCID = dsJCN.Tables[0].Rows[0]["OrderNo"].ToString();
                            string[] TotQC   = grpQCID.Split(',');
                            int      QCCnt   = TotQC.Count();
                            for (int p = 0; p <= QCCnt - 1; p++)
                            {
                                dh.CreatedBy         = profile.Personal.UserID;
                                dh.CreationDate      = DateTime.Now;
                                dh.OID               = long.Parse(TotQC[p].ToString());
                                dh.DispatchDate      = Convert.ToDateTime(d["DispatchDate"]);
                                dh.DispatchBy        = Convert.ToInt64(d["DispatchBy"].ToString());
                                dh.Remark            = d["Remark"].ToString();
                                dh.AirwayBill        = d["AirwayBill"].ToString();
                                dh.ShippingType      = d["ShippingType"].ToString();
                                dh.CompanyID         = profile.Personal.CompanyID;
                                dh.Status            = Convert.ToInt64(d["Status"].ToString());
                                dh.ShippingDate      = Convert.ToDateTime(d["ShippingDate"].ToString());
                                dh.TransporterName   = d["TransporterName"].ToString();
                                dh.TransporterRemark = d["TransporterRemark"].ToString();
                                dh.ExpDeliveryDate   = Convert.ToDateTime(d["ExpDeliveryDate"].ToString());
                                dh.ObjectName        = "SalesOrder";

                                DispatchID = Outbound.SavetDispatchHead(dh, profile.DBConnection._constr);

                                if (DispatchID > 0)
                                {
                                    RSLT = Outbound.FinalSaveDispatchDetail(long.Parse(TotQC[p].ToString()), HttpContext.Current.Session.SessionID, ObjectName, DispatchID, profile.Personal.UserID.ToString(), Convert.ToInt16(dh.Status), "SalesOrder", profile.DBConnection._constr);
                                    if (RSLT == 1 || RSLT == 2)
                                    {
                                        result = DispatchID;
                                    }
                                    else if (RSLT == 0)
                                    {
                                        result = 0;
                                    }
                                    iUC_AttachDocumentClient DocumentSourceClient = new iUC_AttachDocumentClient();//Document Save
                                    DocumentSourceClient.FinalSaveToDBtDocument(HttpContext.Current.Session.SessionID, DispatchID, profile.Personal.UserID.ToString(), ObjectName + "Document", HttpRuntime.AppDomainAppPath.ToString(), profile.DBConnection._constr);
                                }
                            }
                            Outbound.ClearTempDataFromDBDispatch(HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                        }
                    }
                    else
                    {
                        dh.CreatedBy         = profile.Personal.UserID;
                        dh.CreationDate      = DateTime.Now;
                        dh.OID               = long.Parse(HttpContext.Current.Session["QCID"].ToString());
                        dh.DispatchDate      = Convert.ToDateTime(d["DispatchDate"]);
                        dh.DispatchBy        = Convert.ToInt64(d["DispatchBy"].ToString());
                        dh.Remark            = d["Remark"].ToString();
                        dh.AirwayBill        = d["AirwayBill"].ToString();
                        dh.ShippingType      = d["ShippingType"].ToString();
                        dh.CompanyID         = profile.Personal.CompanyID;
                        dh.Status            = Convert.ToInt64(d["Status"].ToString());
                        dh.ShippingDate      = Convert.ToDateTime(d["ShippingDate"].ToString());
                        dh.TransporterName   = d["TransporterName"].ToString();
                        dh.TransporterRemark = d["TransporterRemark"].ToString();
                        dh.ExpDeliveryDate   = Convert.ToDateTime(d["ExpDeliveryDate"].ToString());
                        dh.ObjectName        = "SalesOrder";

                        DispatchID = Outbound.SavetDispatchHead(dh, profile.DBConnection._constr);

                        if (DispatchID > 0)
                        {
                            RSLT = Outbound.FinalSaveDispatchDetail(long.Parse(HttpContext.Current.Session["QCID"].ToString()), HttpContext.Current.Session.SessionID, ObjectName, DispatchID, profile.Personal.UserID.ToString(), Convert.ToInt16(dh.Status), "SalesOrder", profile.DBConnection._constr);
                            if (RSLT == 1 || RSLT == 2)
                            {
                                result = DispatchID;
                            }
                            else if (RSLT == 0)
                            {
                                result = 0;
                            }
                            iUC_AttachDocumentClient DocumentSourceClient = new iUC_AttachDocumentClient();//Document Save
                            DocumentSourceClient.FinalSaveToDBtDocument(HttpContext.Current.Session.SessionID, DispatchID, profile.Personal.UserID.ToString(), ObjectName + "Document", HttpRuntime.AppDomainAppPath.ToString(), profile.DBConnection._constr);
                        }
                        Outbound.ClearTempDataFromDBDispatch(HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                    }
                }
                else if (HttpContext.Current.Session["TRID"] != null)
                {
                    int chkJObCart = Inbound.CheckJobCard(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), "Transfer", profile.DBConnection._constr);
                    if (chkJObCart >= 1)
                    {
                        DataSet dsJCN = new DataSet();
                        dsJCN = Outbound.CheckSelectedSOJobCardNo(Convert.ToInt64(HttpContext.Current.Session["TRID"].ToString()), "Transfer", profile.DBConnection._constr);
                        if (dsJCN != null && dsJCN.Tables[0].Rows.Count > 0)
                        {
                            string   grpQCID = dsJCN.Tables[0].Rows[0]["OrderNo"].ToString();
                            string[] TotQC   = grpQCID.Split(',');
                            int      QCCnt   = TotQC.Count();
                            for (int p = 0; p <= QCCnt - 1; p++)
                            {
                                dh.CreatedBy         = profile.Personal.UserID;
                                dh.CreationDate      = DateTime.Now;
                                dh.OID               = long.Parse(TotQC[p].ToString());
                                dh.DispatchDate      = Convert.ToDateTime(d["DispatchDate"]);
                                dh.DispatchBy        = Convert.ToInt64(d["DispatchBy"].ToString());
                                dh.Remark            = d["Remark"].ToString();
                                dh.AirwayBill        = d["AirwayBill"].ToString();
                                dh.ShippingType      = d["ShippingType"].ToString();
                                dh.CompanyID         = profile.Personal.CompanyID;
                                dh.Status            = Convert.ToInt64(d["Status"].ToString());
                                dh.ShippingDate      = Convert.ToDateTime(d["ShippingDate"].ToString());
                                dh.TransporterName   = d["TransporterName"].ToString();
                                dh.TransporterRemark = d["TransporterRemark"].ToString();
                                dh.ExpDeliveryDate   = Convert.ToDateTime(d["ExpDeliveryDate"].ToString());
                                dh.ObjectName        = "Transfer";

                                DispatchID = Outbound.SavetDispatchHead(dh, profile.DBConnection._constr);

                                if (DispatchID > 0)
                                {
                                    RSLT = Outbound.FinalSaveDispatchDetail(long.Parse(TotQC[p].ToString()), HttpContext.Current.Session.SessionID, ObjectName, DispatchID, profile.Personal.UserID.ToString(), Convert.ToInt16(dh.Status), "Transfer", profile.DBConnection._constr);
                                    if (RSLT == 1 || RSLT == 2)
                                    {
                                        result = DispatchID;
                                    }
                                    else if (RSLT == 0)
                                    {
                                        result = 0;
                                    }
                                    iUC_AttachDocumentClient DocumentSourceClient = new iUC_AttachDocumentClient();//Document Save
                                    DocumentSourceClient.FinalSaveToDBtDocument(HttpContext.Current.Session.SessionID, DispatchID, profile.Personal.UserID.ToString(), ObjectName + "Document", HttpRuntime.AppDomainAppPath.ToString(), profile.DBConnection._constr);
                                }
                            }
                            Outbound.ClearTempDataFromDBDispatch(HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                        }
                    }
                    else
                    {
                        dh.CreatedBy         = profile.Personal.UserID;
                        dh.CreationDate      = DateTime.Now;
                        dh.OID               = long.Parse(HttpContext.Current.Session["TRID"].ToString());
                        dh.DispatchDate      = Convert.ToDateTime(d["DispatchDate"]);
                        dh.DispatchBy        = Convert.ToInt64(d["DispatchBy"].ToString());
                        dh.Remark            = d["Remark"].ToString();
                        dh.AirwayBill        = d["AirwayBill"].ToString();
                        dh.ShippingType      = d["ShippingType"].ToString();
                        dh.CompanyID         = profile.Personal.CompanyID;
                        dh.Status            = Convert.ToInt64(d["Status"].ToString());
                        dh.ShippingDate      = Convert.ToDateTime(d["ShippingDate"].ToString());
                        dh.TransporterName   = d["TransporterName"].ToString();
                        dh.TransporterRemark = d["TransporterRemark"].ToString();
                        dh.ExpDeliveryDate   = Convert.ToDateTime(d["ExpDeliveryDate"].ToString());
                        dh.ObjectName        = "Transfer";

                        DispatchID = Outbound.SavetDispatchHead(dh, profile.DBConnection._constr);

                        if (DispatchID > 0)
                        {
                            RSLT = Outbound.FinalSaveDispatchDetail(long.Parse(HttpContext.Current.Session["TRID"].ToString()), HttpContext.Current.Session.SessionID, ObjectName, DispatchID, profile.Personal.UserID.ToString(), Convert.ToInt16(dh.Status), "Transfer", profile.DBConnection._constr);
                            if (RSLT == 1 || RSLT == 2)
                            {
                                result = DispatchID;
                            }
                            else if (RSLT == 0)
                            {
                                result = 0;
                            }
                            iUC_AttachDocumentClient DocumentSourceClient = new iUC_AttachDocumentClient();//Document Save
                            DocumentSourceClient.FinalSaveToDBtDocument(HttpContext.Current.Session.SessionID, DispatchID, profile.Personal.UserID.ToString(), ObjectName + "Document", HttpRuntime.AppDomainAppPath.ToString(), profile.DBConnection._constr);
                        }
                        Outbound.ClearTempDataFromDBDispatch(HttpContext.Current.Session.SessionID, profile.Personal.UserID.ToString(), ObjectName, profile.DBConnection._constr);
                    }
                }
            }
            catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, "DispatchDetail.aspx", "WMSaveDispatchHead"); result = 0; }
            finally { Outbound.Close(); }
            return(result);
        }