Пример #1
0
    protected void imgBtnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        var otherDal = new OtherDAL();
        EOrderShippingInformation objShippingInfo = new EOrderShippingInformation();

        EZip objzip = otherDal.CheckCityZip(txtCity.Text, txtZip.Text, ddlstate.SelectedItem.Value);

        if (objzip.CityID == 0)
        {
            ClientScript.RegisterStartupScript(typeof(string), "JSCode_CityValidation", "alert('City Name entered is not correct.'); ", true);
            return;
        }
        else if (objzip.ZipID == 0)
        {
            ClientScript.RegisterStartupScript(typeof(string), "JSCode_ZipValidation", "alert('Zip Code entered is not correct.'); ", true);
            return;
        }
        objShippingInfo.OrderShippingInformationID = Convert.ToInt32(Request.QueryString["OrderShippingInformationID"].ToString());
        objShippingInfo.Carrier = Convert.ToInt32(ddlcarrier.SelectedValue);
        objShippingInfo.CarrierTransactionNumber = txtcarriertno.Text;
        objShippingInfo.ShippingDate             = Convert.ToDateTime(txtShippingDate.Text).ToString();
        objShippingInfo.ShippingNotes            = txtShippingNotes.Text;
        objShippingInfo.ShippingAddressID        = Convert.ToInt32(hfAddressID.Value);
        objShippingInfo.TrackingNumber           = txtTrackingNo.Text;

        objShippingInfo.ShippingAddress           = new EAddress();
        objShippingInfo.ShippingAddress.AddressID = Convert.ToInt32(hfAddressID.Value);
        objShippingInfo.ShippingAddress.Address1  = txtAddress1.Text;
        objShippingInfo.ShippingAddress.Address2  = txtAddress2.Text;
        objShippingInfo.ShippingAddress.StateID   = Convert.ToInt32(ddlstate.SelectedValue);
        objShippingInfo.ShippingAddress.CityID    = objzip.CityID;
        objShippingInfo.ShippingAddress.ZipID     = objzip.ZipID;


        objShippingInfo.LastModifiedBy     = Convert.ToInt32(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
        objShippingInfo.LastModifiedByRole = Convert.ToInt32(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.RoleId);

        Int64 returnresult = otherDal.UpdateShippingInfo(objShippingInfo);

        if (returnresult > 0)
        {
            ClientScript.RegisterStartupScript(typeof(string), "jscode_savesuccessful", "parent.parent.GB_hide(); ", true);
        }
        else
        {
            ClientScript.RegisterStartupScript(typeof(string), "jscode_saveerror", "alert('Shipping Information not saved successfully.'); ", true);
        }
    }