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 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 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; } }
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; }