public static bool FinalSave(string HSCode, long HSCodeId, string assHSC, long d, int v, string item) { try { generationflux.ClassificationHeader classHeader; generationflux.ClassificationItems classItem; classHeader = new ClassificationHeader(d, v); classItem = new ClassificationItems(); long selectedItem; long selectedItemHSCodeID; selectedItemHSCodeID = HSCodeId; // ValidateHSCode(HSCode); if (selectedItemHSCodeID == -1) { return false; } else { if (classHeader.ClassID == null || classHeader.ClassID == 0) { classHeader.DeclarationID = d; classHeader.DraftUserID = GlobalFunctions.gLoginUserCode; classHeader.VersionNo = v; classHeader.Create(1); } } //foreach (DataGridViewRow dRow in dgLineItems.SelectedRows) //{ //DataGridViewRow row = dRow; selectedItem = Convert.ToInt64(item); //dRowIndex = row.Index; if (HSCode != assHSC.Trim()) { classItem = new ClassificationItems(); if (string.IsNullOrEmpty(assHSC.Trim())) { classItem.ClassID = classHeader.ClassID; classItem.ItemID = selectedItem; classItem.PartitionDate = (DateTime)classHeader.PartitionDate; classItem.UserID = GlobalFunctions.gLoginUserCode; classItem.HSCodeID = (int)selectedItemHSCodeID; classItem.Remarks = ""; classItem.VersionNo = v; classItem.Create(GlobalFunctions.gLoginUserCode); } else { classItem.ClassID = classHeader.ClassID; classItem.ItemID = selectedItem; classItem.PartitionDate = (DateTime)classHeader.PartitionDate; classItem.UserID = GlobalFunctions.gLoginUserCode; classItem.HSCodeID = (int)selectedItemHSCodeID; classItem.Remarks = ""; classItem.VersionNo = v; classItem.Update(GlobalFunctions.gLoginUserCode); } } //} return true; } catch (Exception ex) { //MessageBox.Show(ex.Message + "\n Could not Save Data", "Generation II", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } }
public static bool SaveQuery(long d, int v, string queryType) { try { generationflux.ClassificationHeader classHeader; long _declID = d; int _VersionNo = v; classHeader = new ClassificationHeader(_declID, _VersionNo); if (classHeader.ClassID == null || classHeader.ClassID == 0) { classHeader.DeclarationID = _declID; classHeader.DraftUserID = GlobalFunctions.gLoginUserCode; classHeader.VersionNo = _VersionNo; classHeader.Create(1); } long SubmissionID = (long)(classHeader.SubmissionID.Value); int VersionNo = (int)(classHeader.VersionNo); int DeptCode = 4; int DeptPriorStatus; if (classHeader.Status != null) { DeptPriorStatus = classHeader.Status.Value; Query.Log((long)SubmissionID, (int)VersionNo, (int)(DeptCode), (int)DeptPriorStatus, Convert.ToInt32(queryType)); } else { DeptPriorStatus = 1; Query.Log((long)SubmissionID, (int)VersionNo, (int)(DeptCode), (int)DeptPriorStatus, Convert.ToInt32(queryType)); } return true; } catch (Exception ex) { //MessageBox.Show(ex.Message + "\n Could not Query File", "Generation II", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } }
//[System.Web.Services.WebMethod] protected void Page_Load(object sender, EventArgs e) { //cstype = this.GetType(); //GlobalFunctions.gLoginUserCode = 451; if (Request.QueryString["d"] != null && Request.QueryString["v"] != null) { _declID = Convert.ToInt64(Request.QueryString["d"].ToString()); _VersionNo = Convert.ToInt16(Request.QueryString["v"].ToString()); } GlobalFunctions.ExecAndFillDataset("spGCICGetQueryType", GlobalFunctions.Initials, "QueryType"); DropDownListQuery.DataSource = GlobalFunctions.Initials.Tables["QueryType"]; DropDownListQuery.DataTextField = "QueryTypeDesc"; DropDownListQuery.DataValueField = "QueryTypeID"; DropDownListQuery.DataBind(); DropDownListQuery.SelectedIndex = -1; if (_declID > 0) { classHeader = new ClassificationHeader(_declID, _VersionNo); classItemsList = new ClassificationItems(); //PopulateData(); _SubmissionID = classHeader.SubmissionID.Value; classItemsList.DeclarationID = _declID; classItemsList.VersionNo = _VersionNo; dgLineItems.DataSource = classItemsList.GetList(); //dgLineItems.SelectionMode = DataGridViewSelectionMode.FullRowSelect; //dgLineItems.MultiSelect = true; dgLineItems.DataBind(); txtIDFNumber.Text = classHeader.IDFNumber; //measure.Value = classHeader.IDFNumber; this.txtDateRecvd.Text = classHeader.IDFDateRecvd.Value.ToString("dd-MMM-yyyy").ToUpper(); this.txtIDFDate.Text = classHeader.IDFDate.Value.ToString("dd-MMM-yyyy").ToUpper(); TextBoxSubmissionID.Text = Convert.ToString(_SubmissionID); TextBoxVersionNo.Text = classHeader.VersionNo.ToString(); //Importer Detals txtImporter.Text = classHeader.ImporterName; /*lblIMPAddress.Text = classHeader.ImporterAddress; lblIMPContact.Text = classHeader.ImporterContact; lblIMPPhone.Text = classHeader.ImporterContactPhone;*/ //Exporter Detals txtExporter.Text = classHeader.ExporterName; /*lblEXPAddress.Text = classHeader.ExporterAddress; lblEXPContact.Text = classHeader.ExporterContactName; lblEXPPhone.Text = classHeader.ExporterContactPhone;*/ //var script = "document.getElementById('sameid').value = 'diff';"; //jQuery('#sameid').val('dff') //ClientScript.RegisterStartupScript(typeof(string), "textvaluesetter", script, true); //Session["searchIDA"] = "14023"; //Roll Back Stuff if (classHeader.RollBackIssueID != null) { filemsg.Text = "This file was rolled back by " + classHeader.RollBackUserName.ToString() + Environment.NewLine + " Date Rolled Back: " + classHeader.RollBackDate.Value.ToString("dd-MMM-yyyy @ hh:mm tt").ToUpper() + Environment.NewLine + " From Department : " + classHeader.RollBackDepartment.ToString() + Environment.NewLine + " Reason : " + classHeader.RollBackMessage.ToString(); } else { filemsg.Text = ""; } } }
public static string SaveClassificationItemsApplyToSelection(string HSCode, long d, int v, string jsonitems) { try { generationflux.ClassificationHeader classHeader; long _declID = d; int _VersionNo = v; string ItemsIDs = jsonitems; long HSCodeID = ValidateHSCode(HSCode); classHeader = new ClassificationHeader(_declID, _VersionNo); //ClassificationItems.SaveApplyHSCodeToSelection((long)classHeader.ClassID, (int)HSCodeID, (int)classHeader.VersionNo, (int)GlobalFunctions.gLoginUserCode, ItemsIDs); //return ItemsIDs; if (HSCodeID == -1) { return "false"; } else { if (classHeader.ClassID == null || classHeader.ClassID == 0) { classHeader.DeclarationID = d; classHeader.DraftUserID = GlobalFunctions.gLoginUserCode; classHeader.Create(1); } ClassificationItems.SaveApplyHSCodeToSelection((long)classHeader.ClassID, (int)HSCodeID, (int)classHeader.VersionNo, (int)GlobalFunctions.gLoginUserCode, ItemsIDs); return "true"; } } catch (Exception ex) { //MessageBox.Show(ex.Message + "\n Could not Save Data", "Generation II", MessageBoxButtons.OK, MessageBoxIcon.Error); return "-1"; } }
public static bool SaveClassificationItemsApplyToAll(long HSCode, long d, int v) { try { generationflux.ClassificationHeader classHeader; classHeader = new ClassificationHeader(d, v); long HSCodeID; HSCodeID = HSCode; if (HSCodeID == -1) { return false; } else { if (classHeader.ClassID == null || classHeader.ClassID == 0) { classHeader.DeclarationID = d; classHeader.DraftUserID = GlobalFunctions.gLoginUserCode; classHeader.Create(1); } ClassificationItems.SaveApplyHSCodeToAll((long)classHeader.ClassID, (int)HSCodeID, (int)classHeader.VersionNo, (int)GlobalFunctions.gLoginUserCode); return true; } } catch (Exception ex) { //MessageBox.Show(ex.Message + "\n Could not Apply All HSCodes", "Generation II", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; } return false; }
public static string Save(string HSCode, long d, int v, string jsonitems) { try { generationflux.ClassificationHeader classHeader; generationflux.ClassificationItems classItemsList; int iterator = 0; long _declID = d; int _VersionNo = v; string ItemsIDs = jsonitems; long HSCodeID = ValidateHSCode(HSCode); classHeader = new ClassificationHeader(_declID, _VersionNo); classItemsList = new ClassificationItems(); ClassificationItems.SaveApplyHSCodeToSelection((long)classHeader.ClassID, (int)HSCodeID, (int)classHeader.VersionNo, (int)GlobalFunctions.gLoginUserCode, ItemsIDs); return ItemsIDs; } catch (Exception ex) { //MessageBox.Show(ex.Message + "\n Could not Save Data", "Generation II", MessageBoxButtons.OK, MessageBoxIcon.Error); return "-1"; } }
public static bool RegisterFile(long d, int v) { try { generationflux.ClassificationHeader classHeader; long _declID = d; int _VersionNo = v; classHeader = new ClassificationHeader(_declID, _VersionNo); return classHeader.RegisterFile(); } catch (SqlException sqlEx) { if (sqlEx.Message.Substring(0, 1).Equals("*")) { MessageBox.Show(string.Format("{0}\n\nFile is not Registered.", sqlEx.Message.Substring(1)), "Generation II", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(string.Format("Error : {0}\n\nFile is not Registered", sqlEx.Message), "Generation II", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show(string.Format("Error : {0}\n\nFile is Successfully Registered", ex.Message), "Generation II", MessageBoxButtons.OK, MessageBoxIcon.Information); } return false; }
public static bool PassToDrafter(long d, int v) { try { generationflux.ClassificationHeader classHeader; long _declID = d; int _VersionNo = v; classHeader = new ClassificationHeader(_declID, _VersionNo); return ClassificationHeader.PassToDrafter(classHeader.ClassID.Value, classHeader.VersionNo); } catch (Exception ex) { //MessageBox.Show(string.Format("Could not Pass File to Drafter.\n\nError Message: {0}", ex.Message), "Generation II", MessageBoxButtons.OK, MessageBoxIcon.Error); //return "Could not Pass File to Drafter.\n\nError Message" ; //return false; Console.WriteLine("Could not Pass File to Drafter." + ex.Message); } return false; }