Пример #1
0
        //[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 = "";
                }
            }
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
        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";
            }
        }