コード例 #1
0
 public frmGeneralCourier(int GeneralCourierID)
 {
     InitializeComponent();
     ItemOfCmbServiceType();
     ItemOfCmbWeightUnit();
     GeneralCourierWebService objWebService = new GeneralCourier.GeneralCourierWebService();
     GeneralCourierInfo objInfo = new GeneralCourierInfo();
     objInfo.GeneralCourierID = GeneralCourierID;
     objInfo = objWebService.GeneralCourierGetByID(objInfo.GeneralCourierID, TokenCleintEncrypt.Encrypt(ClientTokenBuilder.BuildTokens()));
     lblGeneralCourierId.Text = objInfo.GeneralCourierID.ToString();
     txtCourierNumber.Text = objInfo.CourierNumber;
     txtReceiverFirstName.Text = objInfo.ReceiverFirstName;
     txtReceiverMiddleName.Text = objInfo.ReceiverMiddleName;
     txtReceiverLastName.Text = objInfo.ReceiverLastName;
     txtReceiverMobile.Text = objInfo.ReceiverMobile;
     txtReceiverPhone.Text = objInfo.ReceiverPhone;
     txtReceiverAddress.Text = objInfo.ReceiverAddress;
     txtNumberOfPackage.Text = objInfo.NumberOfPackage.ToString();
     txtWeight.Text = objInfo.WeightOfPackage.ToString();
     cmbWeightUnit.SelectedValue = objInfo.WeightUnitID.ToString();
     cmbServiceType.SelectedValue = objInfo.ServiceTypeID.ToString();
     txtCourierCharge.Text = objInfo.CourierCharge.ToString();
     txtSenderFirstName.Text = objInfo.SenderFirstName;
     txtSenderMiddleName.Text = objInfo.SenderMiddleName;
     txtSenderLastName.Text = objInfo.SenderLastName;
     txtSenderMobile.Text = objInfo.SenderMobile;
     txtSenderPhone.Text = objInfo.SenderPhone;
     txtSenderPhone.Text = objInfo.SenderPhone;
     txtSenderAddress.Text = objInfo.SenderAddress;
 }
コード例 #2
0
 /// <remarks/>
 public void GeneralCourierUpdateAsync(GeneralCourierInfo objInfo, string token, object userState) {
     if ((this.GeneralCourierUpdateOperationCompleted == null)) {
         this.GeneralCourierUpdateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGeneralCourierUpdateOperationCompleted);
     }
     this.InvokeAsync("GeneralCourierUpdate", new object[] {
                 objInfo,
                 token}, this.GeneralCourierUpdateOperationCompleted, userState);
 }
コード例 #3
0
 /// <remarks/>
 public void GeneralCourierUpdateAsync(GeneralCourierInfo objInfo, string token) {
     this.GeneralCourierUpdateAsync(objInfo, token, null);
 }
コード例 #4
0
 public void GeneralCourierUpdate(GeneralCourierInfo objInfo, string token) {
     this.Invoke("GeneralCourierUpdate", new object[] {
                 objInfo,
                 token});
 }
コード例 #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateForm())
                {
                    GeneralCourier.GeneralCourierWebService objWebService = new GeneralCourier.GeneralCourierWebService();
                    GeneralCourierInfo objInfo = new GeneralCourierInfo();
                    objInfo.CourierNumber = txtCourierNumber.Text.Trim();
                    objInfo.ReceiverFirstName = txtReceiverFirstName.Text.Trim();
                    objInfo.ReceiverMiddleName = txtReceiverMiddleName.Text.Trim();
                    objInfo.ReceiverLastName = txtReceiverLastName.Text.Trim();
                    objInfo.ReceiverAddress = txtReceiverAddress.Text.Trim();
                    objInfo.ReceiverMobile = txtReceiverMobile.Text.Trim();
                    objInfo.ReceiverPhone = txtReceiverPhone.Text.Trim();
                    objInfo.NumberOfPackage = Convert.ToInt32(txtNumberOfPackage.Text.Trim());
                    objInfo.WeightOfPackage = Convert.ToDecimal(txtWeight.Text.Trim());
                    objInfo.ServiceTypeID = Convert.ToInt32(cmbServiceType.SelectedValue);
                    objInfo.WeightUnitID = Convert.ToInt32(cmbWeightUnit.SelectedValue);
                    objInfo.SenderFirstName = txtSenderFirstName.Text.Trim();
                    objInfo.SenderMiddleName = txtSenderMiddleName.Text.Trim();
                    objInfo.SenderLastName = txtSenderLastName.Text.Trim();
                    objInfo.SenderAddress = txtSenderAddress.Text.Trim();
                    objInfo.SenderMobile = txtSenderMobile.Text.Trim();
                    objInfo.SenderPhone = txtSenderPhone.Text.Trim();
                    objInfo.CourierCharge = Convert.ToDecimal(txtCourierCharge.Text.Trim());
                    int Id = Convert.ToInt32(lblGeneralCourierId.Text);

                    if (Id == 0)
                    {
                        objInfo.AddedBy = GetLoginUser.UserName;
                        objInfo.AddedOn = DateTime.Now;
                        objInfo.UpdatedBy = GetLoginUser.UserName;
                        objWebService.GeneralCourierAdd(objInfo, TokenCleintEncrypt.Encrypt(ClientTokenBuilder.BuildTokens()));
                        MessageBox.Show("Data Saved Successfully...");

                    }
                    else
                    {
                        objInfo.UpdatedBy = GetLoginUser.UserName;
                        objInfo.AddedBy = GetLoginUser.UserName;
                        objInfo.GeneralCourierID = Id;
                        objWebService.GeneralCourierUpdate(objInfo, TokenCleintEncrypt.Encrypt(ClientTokenBuilder.BuildTokens()));
                        MessageBox.Show("Data Updated Successfully...");
                    }
                    ClearField();
                    this.DialogResult = DialogResult.OK;

                }

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #6
0
        private void dataGridViewGeneralCourier_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == dataGridViewGeneralCourier.Columns["clmDelete"].Index)
            {

                try
                {
                    GeneralCourier.GeneralCourierWebService obj = new GeneralCourier.GeneralCourierWebService();
                    GeneralCourierInfo objInfo = new GeneralCourierInfo();
                    objInfo.GeneralCourierID = Convert.ToInt32(dataGridViewGeneralCourier.Rows[e.RowIndex].Cells["clmGeneralCourierID"].Value.ToString());
                    if (DialogResult.Yes == MessageBox.Show("Do You Want Delete ?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                    {
                        obj.GeneralCourierDeleteByID(objInfo.GeneralCourierID, TokenCleintEncrypt.Encrypt(ClientTokenBuilder.BuildTokens()));
                        MessageBox.Show("Data Deleted Successfully");
                        LoadGeneralCourier();
                    }

                }
                catch (Exception ex)
                {
                    throw ex;
                }

            }
            if (e.ColumnIndex == dataGridViewGeneralCourier.Columns["clmEdit"].Index)
            {
                int x = Convert.ToInt32(dataGridViewGeneralCourier.CurrentRow.Cells["clmGeneralCourierID"].Value.ToString());
                frmGeneralCourier objGeneralCourier = new frmGeneralCourier(x);
                objGeneralCourier.ShowDialog();
                dataGridViewGeneralCourier.DataSource = null;
                LoadGeneralCourier();

            }
        }