protected void frmCaseStatus_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     DropDownList dropStatus = frmCaseStatus.FindControl("dropStatus") as DropDownList;
     HiddenField hdnStatus = frmCaseStatus.FindControl("hdnStatus") as HiddenField;
     if (dropStatus.SelectedValue != hdnStatus.Value) { dsCaseStatus.UpdateParameters.Add("status", dropStatus.SelectedValue.ToString()); }
     Response.Redirect("case_details.aspx?cid=" + Request.QueryString["cid"].ToString(), false);
 }
Пример #2
0
    /// <summary>
    /// Save changes in address settings.
    /// </summary>
    /// <param name="sender">Object sender : fvAddress.</param>
    /// <param name="e">FormViewUpdateEventArgs e.</param>
    protected void OnAddressItemUpdating(Object sender, FormViewUpdateEventArgs e)
    {
        DropDownList ddlCountry = fvAddress.FindControl("ddlCountry") as DropDownList;
        DropDownList ddlCity = fvAddress.FindControl("ddlCity") as DropDownList;
        TextBox tbxArea = fvAddress.FindControl("tbxArea") as TextBox;
        TextBox tbxStreet = fvAddress.FindControl("tbxStreet") as TextBox;
        TextBox tbxHome = fvAddress.FindControl("tbxHome") as TextBox;
        TextBox tbxApartment = fvAddress.FindControl("tbxApartment") as TextBox;
        Guid country;
        Guid? vCountry = null;
        Guid city;
        Guid? vCity = null;
        if (Guid.TryParse(ddlCountry.SelectedValue, out country))
        {
            vCountry = country;
        }

        if (Guid.TryParse(ddlCity.SelectedValue, out city))
        {
            vCity = city;
        }

        AddressRepository.ModifyAddress(
            null,
            true,
            this._userID,
            vCountry,
            vCity,
            tbxArea.Text.Trim(),
            tbxStreet.Text.Trim(),
            tbxHome.Text.Trim(),
            tbxApartment.Text.Trim());
    }
Пример #3
0
 protected void frmActivities_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     TextBox Started = frmActivities.FindControl("txtStarted") as TextBox;
     TextBox Due = frmActivities.FindControl("txtDue") as TextBox;
     TextBox Completed = frmActivities.FindControl("txtCompleted") as TextBox;
     HiddenField StartedTime = frmActivities.FindControl("hdnStartedTime") as HiddenField;
     HiddenField DueTime = frmActivities.FindControl("hdnDueTime") as HiddenField;
     HiddenField CompletedTime = frmActivities.FindControl("hdnCompletedTime") as HiddenField;
     if (Started.Text != "")
     {
         dsActivities.UpdateParameters.Add("creationdate", System.Data.DbType.DateTime, Started.Text + " " + StartedTime.Value);
     }
     else
     {
         dsActivities.UpdateParameters.Add("creationdate", null);
     }
     if (Due.Text != "")
     {
         dsActivities.UpdateParameters.Add("duedate", System.Data.DbType.DateTime, Due.Text + " " + DueTime.Value);
     }
     else
     {
         dsActivities.UpdateParameters.Add("duedate", null);
     }
     if (Completed.Text != "")
     {
         dsActivities.UpdateParameters.Add("completiondate", System.Data.DbType.DateTime, Completed.Text + " " + CompletedTime.Value);
     }
     else
     {
         dsActivities.UpdateParameters.Add("completiondate", null);
     }
 }
    protected void FormView_Tarankit_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        RadioButtonList Radio_Tarankit = FormView_Tarankit.FindControl("Radio_tarankit") as RadioButtonList;
        e.NewValues["Tarankit_Atarnkit"] = Radio_Tarankit.SelectedValue;

        DropDownList Drop_mlaname = FormView_Tarankit.FindControl("Drop_mlaname") as DropDownList;
        e.NewValues["mlaName"] = Drop_mlaname.SelectedValue;
    }
Пример #5
0
    protected void FormView_BookFormRegister_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        DropDownList DropDownList1 = FormView_BookFormRegister.FindControl("DropDownListDepartment") as DropDownList;
        e.NewValues["Dept_name"] = DropDownList1.SelectedValue;

        DropDownList DropDown_EmployeeName = FormView_BookFormRegister.FindControl("DropDownList_EmployeeName") as DropDownList;
        e.NewValues["Emp_Name"] = DropDown_EmployeeName.SelectedValue;
    }
Пример #6
0
    protected void FormView_SunavniRegister_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        DropDownList DropDownList_AppealNo = FormView_SunavniRegister.FindControl("DropDownList_AppealNo") as DropDownList;
        e.NewValues["AppealNo"] = DropDownList_AppealNo.SelectedValue;

        DropDownList DropDownList_Versus = FormView_SunavniRegister.FindControl("DropDownList_EmployeeName") as DropDownList;
        e.NewValues["Versus"] = DropDownList_Versus.SelectedValue;
    }
    protected void frmFollowupAction_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        e.NewValues["CompanyId"] = Company.CompanyId;

        if (String.IsNullOrEmpty(e.NewValues["Probability"].ToString()))
            e.NewValues["Probability"] = Convert.ToDecimal("0");
        else
            e.NewValues["Probability"] = Convert.ToDecimal(e.NewValues["Probability"]);
    }
    private void AddUpdateParameterValues(FormViewUpdateEventArgs e)
    {
        ISNet.WebUI.WebCombo.WebCombo paymentInfoWebCombo =
            fvPaymentInfoAudit.FindControl("wcPaymentInfo") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("PaymentInfoGuid", paymentInfoWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebControls.WebInput paymentInfoIDWebInput =
            fvPaymentInfoAudit.FindControl("wiPaymentInfoID") as ISNet.WebUI.WebControls.WebInput;
        e.NewValues.Add("PaymentInfoID", paymentInfoIDWebInput.Text);
    }
Пример #9
0
    private void AddUpdateParameterValues(FormViewUpdateEventArgs e)
    {
        ISNet.WebUI.WebCombo.WebCombo cityStateZipWebCombo =
            fvClient.FindControl("wcCityStateZip") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("CityStateZipGuid", cityStateZipWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebCombo.WebCombo paymentInfoWebCombo =
            fvClient.FindControl("wcPaymentInfo") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("PaymentInfoGuid", paymentInfoWebCombo.SelectedRow.Value);
    }
Пример #10
0
    private void AddUpdateParameterValues(FormViewUpdateEventArgs e)
    {
        ISNet.WebUI.WebCombo.WebCombo facilityWebCombo =
            fvClick.FindControl("wcFacility") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("FacilityGuid", facilityWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebCombo.WebCombo listingTypeWebCombo =
            fvClick.FindControl("wcListingType") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("ListingTypeGuid", listingTypeWebCombo.SelectedRow.Value);
    }
Пример #11
0
    protected void frmServices_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        e.NewValues["CompanyId"] = Company.CompanyId;
        //Formatting the fields 
        e.NewValues["Price"] = Convert.ToDecimal(e.NewValues["Price"].ToString().RemoveMask());
        e.NewValues["TimeInMinutes"] = Convert.ToInt32(e.NewValues["TimeInMinutes"].ToString().RemoveMask());

        if (!String.IsNullOrEmpty(e.NewValues["ISS"].ToString()))
            e.NewValues["ISS"] = Convert.ToDecimal(e.NewValues["ISS"].ToString().RemoveMask());
        else
            e.NewValues["ISS"] = null;
    }
Пример #12
0
 protected void FormViewEmployee_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     if (!String.IsNullOrEmpty(((FileUpload)this.formViewEmployee.FindControl("fuPhotoUpload")).FileName))
         e.NewValues["photo"] = ((FileUpload)this.formViewEmployee.FindControl("fuPhotoUpload")).FileBytes;
     else
     {
         if ((this.formViewEmployee.FindControl("chkRemoveOldImage") as CheckBox).Checked)
             e.NewValues["photo"] = null;
         else
             e.NewValues["photo"] = new Eisk.BusinessLogicLayer.EmployeeBLL().GetEmployeeByEmployeeId(int.Parse(RouteData.Values["employee_id"].ToString())).Photo;
     }
 }
    protected void FormView_Departmental_Inquiry_Register_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        DropDownList dropdown_employeename = FormView_Departmental_Inquiry_Register.FindControl("DropDownList_employeename") as DropDownList;
        e.NewValues["Name_Of_Employee"] = dropdown_employeename.SelectedValue;

        DropDownList DropDown_Grade = FormView_Departmental_Inquiry_Register.FindControl("DropDownList_Grade") as DropDownList;
        e.NewValues["Grade"] = DropDown_Grade.SelectedValue;

        DropDownList DropDown_InquiryOfficer = FormView_Departmental_Inquiry_Register.FindControl("DropDownList_InquiryOfficer") as DropDownList;
        e.NewValues["Name_Of_Inquiry_Officer"] = DropDown_InquiryOfficer.SelectedValue;

        RadioButtonList RadioList_Govt_Dept = FormView_Departmental_Inquiry_Register.FindControl("RadioButtonList_Govt_Dept") as RadioButtonList;
        e.NewValues["Government_Department"] = RadioList_Govt_Dept.SelectedValue;
    }
Пример #14
0
    protected void FormView_Roster_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        ListBox ListBox_Designation = FormView_Roster.FindControl("ListBox_Designation") as ListBox;
        e.NewValues["Deatils_Of_Designation"] = ListBox_Designation.SelectedValue;

        DropDownList DropDown_AnamatType = FormView_Roster.FindControl("DropDownList_AnamatType") as DropDownList;
        e.NewValues["Anamat_Type"] = DropDown_AnamatType.SelectedValue;

        DropDownList DropDown_ReservedCategory = FormView_Roster.FindControl("DropDownList_ReservedCategory") as DropDownList;
        e.NewValues["Reserved_For_Category"] = DropDown_ReservedCategory.SelectedValue;

        DropDownList DropDown_EmployeeName = FormView_Roster.FindControl("DropDownList_EmployeeName") as DropDownList;
        e.NewValues["Employee_Name"] = DropDown_EmployeeName.SelectedValue;
    }
Пример #15
0
    protected void FormView_PIO_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        RadioButtonList Radio_BPL = FormView_PIO.FindControl("Radio_applbpl") as RadioButtonList;
        e.NewValues["Appl_BPL"] = Convert.ToBoolean(Radio_BPL.SelectedValue);

        RadioButtonList Radio_information = FormView_PIO.FindControl("Radio_information") as RadioButtonList;
        e.NewValues["Information"] = Radio_information.SelectedValue;

        DropDownList Drop_FeeMode = FormView_PIO.FindControl("Drop_recvdfessmode") as DropDownList;
        e.NewValues["Recvd_Fees_Mode"] = Drop_FeeMode.SelectedValue;

        RadioButtonList Radio_InfoSend = FormView_PIO.FindControl("Radio_informationsend") as RadioButtonList;
        e.NewValues["Info_Send"] = Convert.ToBoolean(Radio_InfoSend.SelectedValue);
    }
Пример #16
0
    protected void FormViewInforme_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        DropDownList dropDownListTipoMonedaReclamo = FormViewInforme.FindControl("_dropDownListTipoMonedaReclamo") as DropDownList;
        if (dropDownListTipoMonedaReclamo != null && dropDownListTipoMonedaReclamo.SelectedValue != "-1")
        {
            e.NewValues["ReclamoMonedaId"] = dropDownListTipoMonedaReclamo.SelectedValue;
        }

        DropDownList dropDownListTipoMonedaReserva = FormViewInforme.FindControl("_dropDownListTipoMonedaReserva") as DropDownList;
        if (dropDownListTipoMonedaReserva != null && dropDownListTipoMonedaReserva.SelectedValue != "-1")
        {
            e.NewValues["ReservaMonedaId"] = dropDownListTipoMonedaReserva.SelectedValue;
        }
    }
Пример #17
0
    private void AddUpdateParameterValues(FormViewUpdateEventArgs e)
    {
        ISNet.WebUI.WebCombo.WebCombo cityStateZipWebCombo =
            fvFacility.FindControl("wcCityStateZip") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("CityStateZipGuid", cityStateZipWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebCombo.WebCombo clientWebCombo =
            fvFacility.FindControl("wcClient") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("ClientGuid", clientWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebCombo.WebCombo listingTypeWebCombo =
            fvFacility.FindControl("wcListingType") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("ListingTypeGuid", listingTypeWebCombo.SelectedRow.Value);
    }
Пример #18
0
    protected void FormView_ACB_Case_Register_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        DropDownList DropDown_EmployeeName = FormView_ACB_Case_Register.FindControl("DropDownList_EmployeeName") as DropDownList;
        e.NewValues["Employee_Name"] = DropDown_EmployeeName.SelectedValue;

        DropDownList DropDown_Designation = FormView_ACB_Case_Register.FindControl("DropDownList_Designation") as DropDownList;
        e.NewValues["Designation"] = DropDown_Designation.SelectedValue;

        RadioButtonList RadioList_HighCourt = FormView_ACB_Case_Register.FindControl("RadioButtonList_HighCourt") as RadioButtonList;
        e.NewValues["High_court_Appeal"] = Convert.ToBoolean(RadioList_HighCourt.SelectedValue);

        RadioButtonList RadioList_SupremeCourt = FormView_ACB_Case_Register.FindControl("RadioButtonList_SupremeCourt") as RadioButtonList;
        e.NewValues["Supreme_Court_Appeal"] = Convert.ToBoolean(RadioList_SupremeCourt.SelectedValue);
    }
    protected void FormView_TransferAppl_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        ListBox ListBox_Designation = FormView_TransferAppl.FindControl("ListBox_Designation") as ListBox;
        e.NewValues["Details_Of_Designation"] = ListBox_Designation.SelectedValue;

        DropDownList DropDown_EmployeeName = FormView_TransferAppl.FindControl("DropDownList_EmployeeName") as DropDownList;
        e.NewValues["Employee_Name"] = DropDown_EmployeeName.SelectedValue;

        DropDownList DropDown_CurrentPlace = FormView_TransferAppl.FindControl("DropDownList_CurrentPlace") as DropDownList;
        e.NewValues["Current_Place"] = DropDown_CurrentPlace.SelectedValue;

        DropDownList DropDown_ResidenceDistrict = FormView_TransferAppl.FindControl("DropDownList_ResidenceDistrict") as DropDownList;
        e.NewValues["Residence_District"] = DropDown_ResidenceDistrict.SelectedValue;

        DropDownList DropDown_Place_Of_Request = FormView_TransferAppl.FindControl("DropDownList_Place_Of_Request") as DropDownList;
        e.NewValues["Place_Of_Request"] = DropDown_Place_Of_Request.SelectedValue;
    }
    protected void frmCaseDetails_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        TextBox Created = frmCaseDetails.FindControl("txtCreated") as TextBox;
        TextBox Target = frmCaseDetails.FindControl("txtTarget") as TextBox;
        TextBox Closed = frmCaseDetails.FindControl("txtClosed") as TextBox;
        TextBox Jeopardy = frmCaseDetails.FindControl("txtJeopardy") as TextBox;
        HiddenField CreatedTime = frmCaseDetails.FindControl("hdnCreateTime") as HiddenField;
        HiddenField TargetTime = frmCaseDetails.FindControl("hdnTargetTime") as HiddenField;
        HiddenField ClosedTime = frmCaseDetails.FindControl("hdnClosedTime") as HiddenField;
        HiddenField JeopardyTime = frmCaseDetails.FindControl("hdnJeopardyTime") as HiddenField;
        if (Created.Text != "")
        {
            dsCaseDetails.UpdateParameters.Add("createddate", System.Data.DbType.DateTime, Created.Text + " " + CreatedTime.Value);
        }
        else
        {
            dsCaseDetails.UpdateParameters.Add("createddate", null);
        }
        if (Target.Text != "")
        {
            dsCaseDetails.UpdateParameters.Add("target", System.Data.DbType.DateTime, Target.Text + " " + TargetTime.Value);
        }
        else
        {
            dsCaseDetails.UpdateParameters.Add("target", null);
        }
        if (Closed.Text != "")
        {
            dsCaseDetails.UpdateParameters.Add("completeddate", System.Data.DbType.DateTime, Closed.Text + " " + ClosedTime.Value);
        }
        else
        {
            dsCaseDetails.UpdateParameters.Add("completeddate", null);
        }
        if (Jeopardy.Text != "")
        {
            dsCaseDetails.UpdateParameters.Add("jeopardy", System.Data.DbType.DateTime, Jeopardy.Text + " " + JeopardyTime.Value);
        }
        else
        {
            dsCaseDetails.UpdateParameters.Add("jeopardy", null);
        }


    }
Пример #21
0
    private void AddUpdateParameterValues(FormViewUpdateEventArgs e)
    {
        ISNet.WebUI.WebCombo.WebCombo clientWebCombo =
            fvClientAudit.FindControl("wcClient") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("ClientGuid", clientWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebCombo.WebCombo cityStateZipWebCombo =
            fvClientAudit.FindControl("wcCityStateZip") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("CityStateZipGuid", cityStateZipWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebCombo.WebCombo paymentInfoWebCombo =
            fvClientAudit.FindControl("wcPaymentInfo") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("PaymentInfoGuid", paymentInfoWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebControls.WebInput clientIDWebInput =
            fvClientAudit.FindControl("wiClientID") as ISNet.WebUI.WebControls.WebInput;
        e.NewValues.Add("ClientID", clientIDWebInput.Text);
    }
Пример #22
0
    // mainly check the Emails fields when Click Update to update the customer record
    protected void frmCustomer_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        string homePhone = e.NewValues["CustHomePhone"].ToString();
        string busPhone = e.NewValues["CustBusPhone"].ToString();
        homePhone = homePhone.Trim();
        busPhone = busPhone.Trim();

        if (homePhone == "")
        {
            lblError.Text = "Home Phone field need a telephone No.";
            e.Cancel = true;
            return;
        }
        /*
        if (busPhone == "")
        {
            lblError.Text = "Bus Phone field need a telephone No.";
            e.Cancel = true;
            return;
        }
        */
        if (PhonesValidate(ref homePhone))
        {
            e.NewValues["CustHomePhone"] = homePhone;
        }
        else
        {
            e.Cancel = true;
            lblError.Text = "Home Phone field need a valid telephone No.";
        }

        if (PhonesValidate(ref busPhone, true))
        {
            e.NewValues["CustBusPhone"] = busPhone;
        }
        else
        {
            e.Cancel = true;
            // e.KeepInEditMode = true;
            lblError.Text = "Bus Phone field need a valid telephone No.";
        }
    }
Пример #23
0
    protected void FormView_Mahekam_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        ListBox ListBox_Designation = FormView_Mahekam.FindControl("ListBox_Designation") as ListBox;
        e.NewValues["Details_Of_Designation"] = ListBox_Designation.SelectedValue;

        DropDownList DropDown_EmployeeName = FormView_Mahekam.FindControl("DropDownList_EmployeeName") as DropDownList;
        e.NewValues["Employee_Name"] = DropDown_EmployeeName.SelectedValue;

        DropDownList DropDown_Designation = FormView_Mahekam.FindControl("DropDownList_Designation") as DropDownList;
        e.NewValues["Designation"] = DropDown_Designation.SelectedValue;

        DropDownList DropDown_Grade = FormView_Mahekam.FindControl("DropDownList_Grade") as DropDownList;
        e.NewValues["Grade"] = DropDown_Grade.SelectedValue;

        DropDownList DropDown_CurrentOffice = FormView_Mahekam.FindControl("DropDownList_CurrentOffice") as DropDownList;
        e.NewValues["Current_Office"] = DropDown_CurrentOffice.SelectedValue;

        DropDownList DropDown_ResidenceDistrict = FormView_Mahekam.FindControl("DropDownList_ResidenceDistrict") as DropDownList;
        e.NewValues["Residence_District"] = DropDown_ResidenceDistrict.SelectedValue;
    }
Пример #24
0
    protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        FormView fv = (FormView)sender;
        string filename = @"E:\Projects\IGRSS\FINAL\WebApp\Inspection\InspectionCheckList.xml";
        OrderedDictionary coll = new OrderedDictionary();

        XmlDocument doc = new XmlDocument();
        doc.Load(filename);

        foreach (XmlNode Node in doc.SelectNodes("DocumentElement/Items"))
        {
            TextBox txt = (TextBox)fv.FindControl("txt" + Node.Attributes["ItemId"].Value);

            CheckBox chk = (CheckBox)fv.FindControl("chk" + Node.Attributes["ItemId"].Value);
            coll.Add(txt.ID, txt.Text);
            coll.Add(chk.ID, chk.Checked);
        }

        e.NewValues.Add("Values", coll);
    }
Пример #25
0
    private void AddUpdateParameterValues(FormViewUpdateEventArgs e)
    {
        ISNet.WebUI.WebCombo.WebCombo facilityWebCombo =
            fvFacilityAudit.FindControl("wcFacility") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("FacilityGuid", facilityWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebCombo.WebCombo cityStateZipWebCombo =
            fvFacilityAudit.FindControl("wcCityStateZip") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("CityStateZipGuid", cityStateZipWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebCombo.WebCombo clientWebCombo =
            fvFacilityAudit.FindControl("wcClient") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("ClientGuid", clientWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebCombo.WebCombo listingTypeWebCombo =
            fvFacilityAudit.FindControl("wcListingType") as ISNet.WebUI.WebCombo.WebCombo;
        e.NewValues.Add("ListingTypeGuid", listingTypeWebCombo.SelectedRow.Value);

        ISNet.WebUI.WebControls.WebInput facilityIDWebInput =
            fvFacilityAudit.FindControl("wiFacilityID") as ISNet.WebUI.WebControls.WebInput;
        e.NewValues.Add("FacilityID", facilityIDWebInput.Text);
    }
Пример #26
0
    protected void FormView_C_L_Card_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        DropDownList DropDown_Office = FormView_C_L_Card.FindControl("DropDownList_Office") as DropDownList;
        e.NewValues["OfficeName"] = DropDown_Office.SelectedValue;

        DropDownList DropDown_Designation = FormView_C_L_Card.FindControl("DropDownList_Designation") as DropDownList;
        e.NewValues["Designation"] = DropDown_Designation.SelectedValue;

        DropDownList DropDown_EmployeeName = FormView_C_L_Card.FindControl("DropDownList_EmployeeName") as DropDownList;
        e.NewValues["Employee_Name"] = DropDown_EmployeeName.SelectedValue;

        RadioButtonList RadioList_HalfFullDay = FormView_C_L_Card.FindControl("RadioButtonList_HalfFullDay") as RadioButtonList;
        e.NewValues["HalfDay_FullDay"] = RadioList_HalfFullDay.SelectedValue;

        RadioButtonList RadioList_Shift = FormView_C_L_Card.FindControl("RadioButtonList_shift") as RadioButtonList;
        e.NewValues["FirstShift_SecondShift"] = RadioList_Shift.SelectedValue;

        RadioButtonList RadioList_LeaveApproved = FormView_C_L_Card.FindControl("RadioButtonList_LeaveApproved") as RadioButtonList;
        e.NewValues["Leave_Approved_Or_Not"] = Convert.ToBoolean(RadioList_LeaveApproved.SelectedValue);

        DropDownList DropDown_ReasonLeave = FormView_C_L_Card.FindControl("DropDownList_Reason_Leave") as DropDownList;
        e.NewValues["Reason_Name"] = DropDown_EmployeeName.SelectedValue;
    }
Пример #27
0
    protected void OneLanguageEditForm_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        e.Cancel = true;
        if (this.OneLanguageEditForm.CurrentMode == FormViewMode.Edit) {
            TextBox _LangName = (TextBox)this.OneLanguageEditForm.FindControl("LangNameTextBox");
            if (_LangName != null)
            {
                if (Enidc.Web.Business.Language.UpdateLangName(int.Parse(this.OneLanguageEditForm.DataKey.Value.ToString()), _LangName.Text.ToString().Trim()))
                {
                    this.MessageLbl.Text = "Language updated!";
                    this.GridView1.SelectedIndex = -1;
                    this.BindGrid();
                    this.OneLang_ODTS.DataBind();
                }
                else {
                    this.MessageLbl.Text = "Error: Can't update this language!";
                }

            }
            else {
                throw new Exception("Control not found!");
            }
        }
    }
Пример #28
0
    protected void fvDatosGenerales_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        //String msg = e.NewValues.ToString();
        FileUpload archivo= (FileUpload)fvDatosGenerales.FindControl("fupArchivo");
        String fArchivo ;
        int BinLength = archivo.PostedFile.ContentLength;
        if (BinLength > 0)
        {
            byte[] BinBuffer = new byte[BinLength];
            archivo.PostedFile.InputStream.Read(BinBuffer, 0, BinLength);
            string filename = archivo.FileName;
            DateTime dateNow = DateTime.Now;

            fArchivo = dateNow.Day.ToString() + dateNow.Month.ToString() + dateNow.Year.ToString() +
                                    dateNow.Hour.ToString() + dateNow.Minute.ToString() + dateNow.Second.ToString() + dateNow.Millisecond.ToString() +
                                  filename.Substring(filename.LastIndexOf("."));
            archivo.SaveAs(Server.MapPath("Polizas") + "/" + fArchivo);

            e.NewValues.Add("nombreArchivo", fArchivo);
        }
        e.NewValues.Add("productoid", (((DropDownList)this.fvDatosGenerales.FindControl("cbxProducto")).SelectedValue).ToString());
        e.NewValues.Add("ramoid", (((DropDownList)this.fvDatosGenerales.FindControl("cbxRamo")).SelectedValue).ToString());
        e.NewValues.Add("coberturaid", (((DropDownList)this.fvDatosGenerales.FindControl("cbxCobertura")).SelectedValue).ToString());
    }
Пример #29
0
 protected void FormViewMyAlert_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     Session["brandID"] = ((DropDownList)FormViewMyAlert.FindControl("ddlBrand")).SelectedValue;
     Session["expDate"] = DateTime.Parse(((TextBox)FormViewMyAlert.FindControl("expireDateTextBox")).Text);
 }
Пример #30
0
 protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     //
     int i = e.NewValues.Count;
 }
Пример #31
0
 protected void FormViewExhitbition_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     Session["sDate"] = DateTime.Parse(((TextBox)FormViewExhitbition.FindControl("startDateTextBox")).Text);
     Session["eDate"] = DateTime.Parse(((TextBox)FormViewExhitbition.FindControl("endDateTextBox")).Text);
 }
Пример #32
0
    //end formview inserting
    /// <summary>
    /// by binding in code behind we can avoid objectdatasource not updating nullable values correctly
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void fmvAddressBook_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        int _id      = wwi_func.vint(get_token("pid"));
        int?_intnull = null;

        if (_id > 0)
        {
            FormView _f = (FormView)this.FindControl("fmvAddressBook");
            if (_f != null)
            {
                //ASPxLabel _lb = (ASPxLabel)_f.FindControl("dxlblCompanyID");
                //if (_lb != null) { _id = _lb.Text.ToString(); }

                NameAndAddressBook _n = new NameAndAddressBook(_id);

                ASPxTextBox _tx = (ASPxTextBox)_f.FindControl("dxtxtName");
                if (_tx != null)
                {
                    _n.CompanyName = _tx.Text != null?_tx.Text.ToString() : "";
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtAddress1");
                if (_tx != null)
                {
                    _n.Address1 = _tx.Text != null?_tx.Text.ToString() : "";
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtAddress2");
                if (_tx != null)
                {
                    _n.Address2 = _tx.Text != null?_tx.Text.ToString() : "";
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtAddress3");
                if (_tx != null)
                {
                    _n.Address3 = _tx.Text != null?_tx.Text.ToString() : "";
                }

                ASPxComboBox _cb = (ASPxComboBox)_f.FindControl("dxcboCountry");
                if (_cb != null)
                {
                    _n.CountryID = wwi_func.vint(_cb.Value.ToString());
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtPostCode");
                if (_tx != null)
                {
                    _n.PostCode = _tx.Text != null?_tx.Text.ToString() : "";
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtTelNo");
                if (_tx != null)
                {
                    _n.TelNo = _tx.Text != null?_tx.Text.ToString() : "";
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtFax");
                if (_tx != null)
                {
                    _n.FaxNo = _tx.Text != null?_tx.Text.ToString() : "";
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtEmail");
                if (_tx != null)
                {
                    _n.MainEmail = _tx.Text != null?_tx.Text.ToString() : "";
                }

                _cb = (ASPxComboBox)_f.FindControl("dxcboCompanyType");
                if (_cb != null)
                {
                    _n.TypeID = _cb.Value != null?wwi_func.vint(_cb.Value.ToString()) : _intnull;
                }

                ASPxMemo _m = (ASPxMemo)_f.FindControl("dxmemoDelivery");
                if (_m != null)
                {
                    _n.SpecialDeliveryInstructions = _m.Text != null?_m.Text.ToString() : "";
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtPalletSpec");
                if (_tx != null)
                {
                    _n.PalletDims = _tx.Text != null?_tx.Text.ToString() : "";
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtMaxWeight"); //check for nullable int
                if (_tx != null)
                {
                    int?_v = 0;
                    if (!string.IsNullOrEmpty(_tx.Text.ToString()))
                    {
                        _v = wwi_func.vint(_tx.Text.ToString());
                    }
                    _n.MaxPalletWeight = _v;
                }

                _tx = (ASPxTextBox)_f.FindControl("dxtxtMaxHeight"); //check for nullable int
                if (_tx != null)
                {
                    int?_v = 0;
                    if (!string.IsNullOrEmpty(_tx.Text.ToString()))
                    {
                        _v = wwi_func.vint(_tx.Text.ToString());
                    }
                    _n.MaxPalletHeight = _v;
                }

                ASPxCheckBox _ck = (ASPxCheckBox)_f.FindControl("dxckExporter");
                if (_ck != null)
                {
                    _n.Exporter = _ck.Checked;
                }

                _ck = (ASPxCheckBox)_f.FindControl("dxckCustomer");
                if (_ck != null)
                {
                    _n.Customer = _ck.Checked;
                }

                _ck = (ASPxCheckBox)_f.FindControl("dxckConsignee");
                if (_ck != null)
                {
                    _n.Consignee = _ck.Checked;
                }

                _ck = (ASPxCheckBox)_f.FindControl("dxckInsurance");
                if (_ck != null)
                {
                    _n.Insurance = _ck.Checked;
                }

                _ck = (ASPxCheckBox)_f.FindControl("dxckSalesTarget");
                if (_ck != null)
                {
                    _n.SalesModule = _ck.Checked;
                }

                _n.Save();
            }
            //end formview updating
        }
    }
Пример #33
0
    protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        SqlConnection cnn = new SqlConnection(ConfigurationManager.ConnectionStrings["fccl2ConnectionString"].ConnectionString);
        SqlCommand    cmd = new SqlCommand();

        cmd.Connection = cnn;
        string codbare      = e.NewValues["CodBare"].ToString().Trim();;
        string prelevatorid = e.NewValues["PrelevatoriId"].ToString().Trim();

        string strid          = e.NewValues["IdZilnic"].ToString().Trim();
        string datatestare    = e.NewValues["DataTestare"].ToString().Trim();
        string datatestarefin = e.NewValues["DataTestareFinala"].ToString().Trim();
        string dataprimirii   = e.NewValues["DataPrimirii"].ToString().Trim();
        string dataprelevare  = e.NewValues["DataPrelevare"].ToString().Trim();

        Label1.Text = "";
        if (!ValidateDate(datatestare))
        {
            Label1.Text = "Data testarii invalida!";
            e.Cancel    = true;
            return;
        }

        if (!ValidateDate(datatestarefin))
        {
            Label1.Text = "Data testarii finale invalida!";
            e.Cancel    = true;
            return;
        }
        if (!ValidateDate(dataprelevare))
        {
            Label1.Text = "Data prelevare invalida!";
            e.Cancel    = true;
            return;
        }
        if (!ValidateDate(dataprimirii))
        {
            Label1.Text = "Data primirii invalida!";
            e.Cancel    = true;
            return;
        }

        // verific cod ferma
        if (prelevatorid != "0")
        {
            cmd.CommandText = "SELECT * from FERME_CCL WHERE Cod ='" + codbare.Substring(0, 5) + "'";
            cnn.Open();
            SqlDataReader reader = cmd.ExecuteReader();
            if (!reader.Read())
            {
                Label1.Text = "Codul de ferma " + codbare.Substring(0, 5) + " nu exista!";
                e.Cancel    = true;
                reader.Close();
                cnn.Close();
                return;
            }
            else
            {
                Label1.Text = "";
                reader.Close();
                cnn.Close();
            }
        }
        // verific id zilnic
        if (strid != "")
        {
            cmd.CommandText = "SELECT * from MostreTancuri Where IdZilnic =" + strid + " AND DataTestare ='" + datatestare + "'";
            cnn.Open();
            SqlDataReader reader = cmd.ExecuteReader();
            int           count  = 0;
            while (reader.Read())
            {
                count++;
            }
            if (count > 1)
            {
                reader.Close();
                //get max id
                cmd.CommandText = "SELECT MAX(IdZilnic) AS MaxId from MostreTancuri Where Datatestare='" +
                                  datatestare + "'";
                reader = cmd.ExecuteReader();
                int idzilnic = 1;
                if (reader.Read())
                {
                    if (!reader.IsDBNull(0))
                    {
                        idzilnic = Convert.ToInt32(reader["MaxId"]) + 1;
                    }
                }
                e.NewValues["IdZilnic"] = Convert.ToString(idzilnic);
                reader.Close();
                cnn.Close();
            }
        }
        else
        {
            cmd.CommandText = "SELECT MAX(IdZilnic) AS MaxId from MostreTancuri Where Datatestare='" + datatestare + "'";
            cnn.Open();
            SqlDataReader reader   = cmd.ExecuteReader();
            int           idzilnic = 1;
            if (reader.Read())
            {
                if (!reader.IsDBNull(0))
                {
                    idzilnic = Convert.ToInt32(reader["MaxId"]) + 1;
                }
            }
            e.NewValues["IdZilnic"] = Convert.ToString(idzilnic);
            reader.Close();
            cnn.Close();
        }
        //verific fcb
        string numeprelevator = e.NewValues["PrelevatoriNume"].ToString().Trim();
        string numeclient     = e.NewValues["FabriciNume"].ToString().Trim();
        string adresaclient   = e.NewValues["FabriciStrada"].ToString().Trim();
        string locclient      = e.NewValues["FabriciOras"].ToString().Trim();
        string judclient      = e.NewValues["FabriciJudet"].ToString().Trim();
        string numeproba      = e.NewValues["NumeProba"].ToString().Trim();

        if (prelevatorid != "0" && (numeprelevator != "" || numeclient != "" ||
                                    adresaclient != "" || locclient != "" || judclient != "" || numeproba != ""))
        {
            Label1.Text = "Au fost completate simultan date pt. FCB si Cod Bare!";
            e.Cancel    = true;
            return;
        }
        Label1.Text = "";
        if (prelevatorid.Equals("0") && numeprelevator.Equals(""))
        {
            Label1.Text = "Nu a fost completat prelevatorul!";
            e.Cancel    = true;
            return;
        }
        Label1.Text = "";
    }
Пример #34
0
 protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     e.NewValues["InputPerson"] = base.user.UserCode;
     e.NewValues["Money"]       = Math.Round(((WebNumericEdit)this.FormView1.Row.FindControl("txtPrice")).ValueDecimal * ((WebNumericEdit)this.FormView1.Row.FindControl("Area")).ValueDecimal, 2);
     e.Cancel = InvalidInput();
 }
Пример #35
0
 protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     // 最終更新日時と最終更新者をセットする
     e.NewValues["update_date"]       = DateTime.Now;
     e.NewValues["update_staff_name"] = Session["StaffName"];
 }
Пример #36
0
    protected void fvHR_WACEmployee_Training_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        PK_ParticipantTraining = Convert.ToInt32(fvHR_WACEmployee_Training.DataKey.Value);
        DropDownList ddlPosition     = fvHR_WACEmployee_Training.FindControl("ddlPosition") as DropDownList;
        DropDownList ddlFiscalYear   = fvHR_WACEmployee_Training.FindControl("ddlFiscalYear") as DropDownList;
        DropDownList ddlTrainingReqd = fvHR_WACEmployee_Training.FindControl("ddlTrainingReqd") as DropDownList;
        TextBox      tbCompDate      = fvHR_WACEmployee_Training.FindControl("AjaxCalendar_CompDate").FindControl("tb") as TextBox;
        TextBox      tbExpDate       = fvHR_WACEmployee_Training.FindControl("AjaxCalendar_ExpDate").FindControl("tb") as TextBox;
        TextBox      tbNote          = fvHR_WACEmployee_Training.FindControl("tbNote") as TextBox;

        using (WACDataClassesDataContext wac = new WACDataClassesDataContext())
        {
            try
            {
                var x = wac.participantWAC_trainings.Where(w => w.pk_participantWAC_training == PK_ParticipantTraining).Select(s => s).Single();
                if (!string.IsNullOrEmpty(ddlPosition.SelectedValue))
                {
                    x.fk_positionWAC_code = ddlPosition.SelectedValue;
                }
                else
                {
                    throw new Exception("Blank or invalid Position. Position is required");
                }
                if (!string.IsNullOrEmpty(ddlFiscalYear.SelectedValue))
                {
                    x.fk_fiscalYear_code = ddlFiscalYear.SelectedValue;
                }
                else
                {
                    throw new Exception("Blank or invalid Fiscal Year.  Fiscal year is required");
                }
                if (!string.IsNullOrEmpty(ddlTrainingReqd.SelectedValue))
                {
                    x.fk_trainingReqd_code = ddlTrainingReqd.SelectedValue;
                }
                else
                {
                    throw new Exception("Blank or invalid Training.  Training is required");
                }
                try { x.completed_date = Convert.ToDateTime(tbCompDate.Text); }
                catch { throw new Exception("Blank or invalid Completion Date. Completion Date is required. "); }
                try { x.expiration_date = Convert.ToDateTime(tbExpDate.Text); }
                catch {}
                if (!string.IsNullOrEmpty(tbNote.Text))
                {
                    x.note = tbNote.Text;
                }
                else
                {
                    x.note = null;
                }
                x.modified    = DateTime.Now;
                x.modified_by = Session["userName"].ToString();
                wac.SubmitChanges();
                fvHR_WACEmployee_Training.ChangeMode(FormViewMode.ReadOnly);
                BindHR_WACEmployee_Training();
                OnFormActionCompleted(this, new FormViewEventArgs(FK_ParticipantWAC, "training"));
            }
            catch (Exception ex) { WACAlert.Show("Error: " + ex.Message, 0); }
        }
    }
Пример #37
0
    protected void fvParticipant_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        DropDownList ddlActive           = fvParticipant.FindControl("ddlActive") as DropDownList;
        DropDownList ddlPrefix           = fvParticipant.FindControl("ddlPrefix") as DropDownList;
        TextBox      tbNameFirst         = fvParticipant.FindControl("tbNameFirst") as TextBox;
        TextBox      tbNameMiddle        = fvParticipant.FindControl("tbNameMiddle") as TextBox;
        TextBox      tbNameLast          = fvParticipant.FindControl("tbNameLast") as TextBox;
        DropDownList ddlSuffix           = fvParticipant.FindControl("ddlSuffix") as DropDownList;
        TextBox      tbNickname          = fvParticipant.FindControl("tbNickname") as TextBox;
        DropDownList ddlOrganization     = fvParticipant.FindControl("UC_DropDownListByAlphabet_Organization").FindControl("ddl") as DropDownList;
        TextBox      tbEmail             = fvParticipant.FindControl("tbEmail") as TextBox;
        TextBox      tbWeb               = fvParticipant.FindControl("tbWeb") as TextBox;
        DropDownList ddlRegionWAC        = fvParticipant.FindControl("ddlRegionWAC") as DropDownList;
        DropDownList ddlMailingStatus    = fvParticipant.FindControl("ddlMailingStatus") as DropDownList;
        DropDownList ddlGender           = fvParticipant.FindControl("ddlGender") as DropDownList;
        DropDownList ddlEthnicity        = fvParticipant.FindControl("ddlEthnicity") as DropDownList;
        DropDownList ddlRace             = fvParticipant.FindControl("ddlRace") as DropDownList;
        DropDownList ddlDiversityData    = fvParticipant.FindControl("ddlDiversityData") as DropDownList;
        Calendar     calFormW9SignedDate = fvParticipant.FindControl("UC_EditCalendar_Participant_FormW9SignedDate").FindControl("cal") as Calendar;

        using (WACDataClassesDataContext wDataContext = new WACDataClassesDataContext())
        {
            try
            {
                var a = wDataContext.participants.Where(o => o.pk_participant == Convert.ToInt32(fvParticipant.DataKey.Value)).Select(s => s).Single();

                if (!string.IsNullOrEmpty(ddlActive.SelectedValue))
                {
                    a.active = ddlActive.SelectedValue;
                }

                if (!string.IsNullOrEmpty(ddlPrefix.SelectedValue))
                {
                    a.fk_prefix_code = ddlPrefix.SelectedValue;
                }
                else
                {
                    a.fk_prefix_code = null;
                }

                a.fname = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbNameFirst.Text, 48).Trim();
                a.mname = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbNameMiddle.Text, 24).Trim();
                a.lname = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbNameLast.Text, 48).Trim();

                if (!string.IsNullOrEmpty(ddlSuffix.SelectedValue))
                {
                    a.fk_suffix_code = ddlSuffix.SelectedValue;
                }
                else
                {
                    a.fk_suffix_code = null;
                }

                a.nickname = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbNickname.Text, 24).Trim();

                if (!string.IsNullOrEmpty(ddlOrganization.SelectedValue))
                {
                    a.fk_organization = Convert.ToInt32(ddlOrganization.SelectedValue);
                }
                else
                {
                    a.fk_organization = null;
                }

                a.email = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbEmail.Text, 48).Trim();
                a.web   = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbWeb.Text, 96).Trim();

                if (!string.IsNullOrEmpty(ddlRegionWAC.SelectedValue))
                {
                    a.fk_regionWAC_code = ddlRegionWAC.SelectedValue;
                }
                else
                {
                    a.fk_regionWAC_code = null;
                }

                a.fk_mailingStatus_code = ddlMailingStatus.SelectedValue;
                a.fk_gender_code        = ddlGender.SelectedValue;
                a.fk_ethnicity_code     = ddlEthnicity.SelectedValue;
                a.fk_race_code          = ddlRace.SelectedValue;
                a.fk_diversityData_code = ddlDiversityData.SelectedValue;

                if (calFormW9SignedDate.SelectedDate.Year > 1900)
                {
                    a.form_W9_signed_date = calFormW9SignedDate.SelectedDate;
                }
                else
                {
                    a.form_W9_signed_date = null;
                }

                //if (!string.IsNullOrEmpty(hfPropertyPK.Value)) a.fk_property = Convert.ToInt32(hfPropertyPK.Value);
                //else a.fk_property = null;

                a.modified    = DateTime.Now;
                a.modified_by = Session["userName"].ToString();

                wDataContext.SubmitChanges();
                fvParticipant.ChangeMode(FormViewMode.ReadOnly);
                BindParticipant(Convert.ToInt32(fvParticipant.DataKey.Value));
            }
            catch (Exception ex) { WACAlert.Show(ex.Message, 0); }
        }
    }
Пример #38
0
 protected void FvItemMaster_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     Global.SetFormViewParameters(e.NewValues, Purchase.GetItemMasterRow());
 }
    protected void MontosRestringidos_FormView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        FormView MyFormView = (FormView)sender;

        if (!User.Identity.IsAuthenticated)
        {
            FormsAuthentication.SignOut();
            return;
        }

        DateTime b;

        if (e.NewValues["Fecha"].ToString() == "" || e.NewValues["Fecha"] == null ||
            !DateTime.TryParse(e.NewValues["Fecha"].ToString(), out b))
        {
            ErrMessage_Span.InnerHtml        = "Ud. debe indicar un valor para el item Fecha.";
            ErrMessage_Span.Style["display"] = "block";

            e.Cancel = true;
            return;
        }

        if (!(e.NewValues["DesactivarEl"].ToString() == "" || e.NewValues["DesactivarEl"] == null) &&
            !DateTime.TryParse(e.NewValues["DesactivarEl"].ToString(), out b))
        {
            ErrMessage_Span.InnerHtml        = "Ud. debe indicar un valor valido para el item Fecha Desactivación.";
            ErrMessage_Span.Style["display"] = "block";

            e.Cancel = true;
            return;
        }

        Decimal a;

        if (e.NewValues["Monto"].ToString() == "" || e.NewValues["Monto"] == null ||
            !Decimal.TryParse(e.NewValues["Monto"].ToString(), out a))
        {
            ErrMessage_Span.InnerHtml        = "Ud. debe indicar un valor para el item Monto.";
            ErrMessage_Span.Style["display"] = "block";

            e.Cancel = true;
            return;
        }

        if (e.NewValues["Comentarios"].ToString() == "" || e.NewValues["Comentarios"] == null)
        {
            ErrMessage_Span.InnerHtml        = "Ud. debe indicar un valor para el item Observaciones.";
            ErrMessage_Span.Style["display"] = "block";

            e.Cancel = true;
            return;
        }

        // inicializamos el valor de estos items en el registro

        // si no hacemos ésto, la fecha es leída como m-d-y
        if (e.NewValues["Fecha"] != null)
        {
            DateTime MyDate = DateTime.Parse(e.NewValues["Fecha"].ToString());
            e.NewValues["Fecha"] = DateTime.Parse(MyDate.ToString("yyyy-MM-dd"));
        }

        if (e.NewValues["DesactivarEl"] != "" && e.NewValues["DesactivarEl"] != null)
        {
            DateTime MyDate = DateTime.Parse(e.NewValues["DesactivarEl"].ToString());
            e.NewValues["DesactivarEl"] = DateTime.Parse(MyDate.ToString("yyyy-MM-dd"));
        }

        if (e.NewValues["Monto"] != null)
        {
            Decimal MyMonto = Decimal.Parse(e.NewValues["Monto"].ToString());
            e.NewValues["Monto"] = Decimal.Parse(MyMonto.ToString("N2"));
        }

        e.NewValues["UltAct_Fecha"]   = DateTime.Now;
        e.NewValues["UltAct_Usuario"] = User.Identity.Name;
    }
Пример #40
0
    /// <summary>
    /// Método que é executado com a formview é submetida para update.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void FormView1_OnUpdating(object sender, FormViewUpdateEventArgs e)
    {
        //Primeira verificação: Verificar existência de ficheiro e fazer upload do thumbnail
        FileUpload fileUpload1 = (FileUpload)FormView1.FindControl("FileUploadThumbnail");

        if (fileUpload1.HasFile)
        {
            if (fileUpload1.PostedFile.ContentType == "image/jpg" || fileUpload1.PostedFile.ContentType == "image/jpeg" || fileUpload1.PostedFile.ContentType == "image/pjpeg")
            {
                string path     = (Server.MapPath("~//files//content//thumbnails//" + fileUpload1.FileName));
                string ficheiro = fileUpload1.FileName;
                if (File.Exists(path))
                {
                    int contador = 0;
                    do
                    {
                        contador++;
                        ficheiro = Convert.ToString(contador) + ficheiro;
                        path     = (Server.MapPath("~//files//content//thumbnails//" + ficheiro));
                    } while (File.Exists(path) == true);
                }
                //A seguinte linha actualiza o parametro que é passado no comando SQL do Datasource escolhido. É este valor que é guardado na base de dados.
                e.NewValues["thumbnail_image"] = ficheiro;
                fileUpload1.SaveAs(Server.MapPath("~//files//content//thumbnails//" + ficheiro));
            }
            else
            {
            }

            /*
             * Código para cancelar o insert no caso de falta de ficheiro :)
             * else
             * {
             *  e.Cancel = true;
             *
             * }
             */
        }
        //Fim de primeira verificação

        //Segunda verificação: Verificar existência de ficheiro e fazer upload da imagem principal do conteúdo
        FileUpload fileUpload2 = (FileUpload)FormView1.FindControl("FileUploadContentImage");

        if (fileUpload2.HasFile)
        {
            if (fileUpload2.PostedFile.ContentType == "image/jpg" || fileUpload2.PostedFile.ContentType == "image/jpeg" || fileUpload2.PostedFile.ContentType == "image/pjpeg")
            {
                string path     = (Server.MapPath("~//files//content//images//" + fileUpload2.FileName));
                string ficheiro = fileUpload2.FileName;
                if (File.Exists(path))
                {
                    int contador = 0;
                    do
                    {
                        contador++;
                        ficheiro = Convert.ToString(contador) + ficheiro;
                        path     = (Server.MapPath("~//files//content//images//" + ficheiro));
                    } while (File.Exists(path) == true);
                }
                //A seguinte linha actualiza o parametro que é passado no comando SQL do Datasource escolhido. É este valor que é guardado na base de dados.
                e.NewValues["content_image"] = ficheiro;
                fileUpload2.SaveAs(Server.MapPath("~//files//content//images//" + ficheiro));
            }
            else
            {
            }

            /*
             * Código para cancelar o insert no caso de falta de ficheiro :)
             * else
             * {
             *  e.Cancel = true;
             *
             * }
             */
        }
        //Fim de segunda verificação

        //Terceira verificação: Verificar existência de ficheiro e fazer upload da imagem de thumbnail/preview no interface mobile
        FileUpload fileUpload3 = (FileUpload)FormView1.FindControl("FileUploadMobileThumbnail");

        if (fileUpload3.HasFile)
        {
            if (fileUpload3.PostedFile.ContentType == "image/jpg" || fileUpload3.PostedFile.ContentType == "image/jpeg" || fileUpload3.PostedFile.ContentType == "image/pjpeg")
            {
                string path     = (Server.MapPath("~//files//content//mobile_thumbnails//" + fileUpload3.FileName));
                string ficheiro = fileUpload3.FileName;
                if (File.Exists(path))
                {
                    int contador = 0;
                    do
                    {
                        contador++;
                        ficheiro = Convert.ToString(contador) + ficheiro;
                        path     = (Server.MapPath("~//files//content//mobile_thumbnails//" + ficheiro));
                    } while (File.Exists(path) == true);
                }
                e.NewValues["mobile_thumbnail"] = ficheiro;
                fileUpload3.SaveAs(Server.MapPath("~//files//content//mobile_thumbnails//" + ficheiro));
            }
            else
            {
            }
        }
        //Fim de terceira verificação

        //Quarta verificação: Verificar existência de ficheiro e fazer upload da imagem principal de conteúdo no interface mobile
        FileUpload fileUpload4 = (FileUpload)FormView1.FindControl("FileUploadMobileImage");

        if (fileUpload4.HasFile)
        {
            if (fileUpload4.PostedFile.ContentType == "image/jpg" || fileUpload4.PostedFile.ContentType == "image/jpeg" || fileUpload4.PostedFile.ContentType == "image/pjpeg")
            {
                string path     = (Server.MapPath("~//files//content//mobile_images//" + fileUpload4.FileName));
                string ficheiro = fileUpload4.FileName;
                if (File.Exists(path))
                {
                    int contador = 0;
                    do
                    {
                        contador++;
                        ficheiro = Convert.ToString(contador) + ficheiro;
                        path     = (Server.MapPath("~//files//content//mobile_images//" + ficheiro));
                    } while (File.Exists(path) == true);
                }
                e.NewValues["mobile_image"] = ficheiro;
                fileUpload4.SaveAs(Server.MapPath("~//files//content//mobile_images//" + ficheiro));
            }
            else
            {
            }
        }
        //Fim de quarta verificação
    }
Пример #41
0
    protected void fvList_Ag_BMPPractice_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        TextBox      tbPractice             = fvList_Ag_BMPPractice.FindControl("tbPractice") as TextBox;
        DropDownList ddlAgency              = fvList_Ag_BMPPractice.FindControl("ddlAgency") as DropDownList;
        DropDownList ddlLifespan            = fvList_Ag_BMPPractice.FindControl("ddlLifespan") as DropDownList;
        DropDownList ddlAgronomic           = fvList_Ag_BMPPractice.FindControl("ddlAgronomic") as DropDownList;
        DropDownList ddlUnit                = fvList_Ag_BMPPractice.FindControl("ddlUnit") as DropDownList;
        DropDownList ddlWACPracticeCategory = fvList_Ag_BMPPractice.FindControl("ddlWACPracticeCategory") as DropDownList;
        TextBox      tbABC     = fvList_Ag_BMPPractice.FindControl("tbABC") as TextBox;
        TextBox      tbABCNote = fvList_Ag_BMPPractice.FindControl("tbABCNote") as TextBox;
        DropDownList ddlActive = fvList_Ag_BMPPractice.FindControl("ddlActive") as DropDownList;

        StringBuilder sb = new StringBuilder();

        using (WACDataClassesDataContext wDataContext = new WACDataClassesDataContext())
        {
            try
            {
                var a = wDataContext.list_bmpPractices.Where(w => w.pk_bmpPractice_code == Convert.ToDecimal(fvList_Ag_BMPPractice.DataKey.Value)).Select(s => s).Single();

                if (!string.IsNullOrEmpty(tbPractice.Text))
                {
                    a.practice = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbPractice.Text, 96);
                }
                else
                {
                    sb.Append("Practice was not updated. Practice is required. ");
                }

                if (!string.IsNullOrEmpty(ddlAgency.SelectedValue))
                {
                    a.fk_agency_code = ddlAgency.SelectedValue;
                }
                else
                {
                    a.fk_agency_code = null;
                }

                a.life_reqd_yr = Convert.ToByte(ddlLifespan.SelectedValue);

                if (!string.IsNullOrEmpty(ddlAgronomic.SelectedValue))
                {
                    a.agronomic = ddlAgronomic.SelectedValue;
                }
                else
                {
                    a.agronomic = null;
                }

                if (!string.IsNullOrEmpty(ddlUnit.SelectedValue))
                {
                    a.fk_unit_code = ddlUnit.SelectedValue;
                }
                else
                {
                    a.fk_unit_code = null;
                }

                if (!string.IsNullOrEmpty(ddlWACPracticeCategory.SelectedValue))
                {
                    a.fk_list_wacPracticeCategory = Convert.ToInt32(ddlWACPracticeCategory.SelectedValue);
                }
                else
                {
                    a.fk_list_wacPracticeCategory = null;
                }

                if (!string.IsNullOrEmpty(tbABC.Text))
                {
                    try { a.ABC = Convert.ToDecimal(tbABC.Text); }
                    catch { sb.Append("ABC was not updated. Must be a number (Interger). "); }
                }

                if (!string.IsNullOrEmpty(tbABCNote.Text))
                {
                    a.ABC_note = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbABCNote.Text, 255);
                }
                else
                {
                    a.ABC_note = null;
                }

                a.active = ddlActive.SelectedValue;

                wDataContext.SubmitChanges();
                fvList_Ag_BMPPractice.ChangeMode(FormViewMode.ReadOnly);
                BindData_Ag_BMPPractice(Convert.ToDecimal(fvList_Ag_BMPPractice.DataKey.Value));

                if (!string.IsNullOrEmpty(sb.ToString()))
                {
                    WACAlert.Show(sb.ToString(), 0);
                }
            }
            catch (Exception ex) { WACAlert.Show(ex.Message, 0); }
        }
    }
Пример #42
0
        protected void FormView1Ai_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            var savedTime = DateTime.Now;

            e.NewValues["SavedTime"] = savedTime;


            var currentUser   = Membership.GetUser();
            var currentUserId = (Guid)currentUser.ProviderUserKey;

            e.NewValues["SavedBy"] = currentUserId;

            e.NewValues["ReleaseStatus"] = "False";


            var chk1     = (CheckBox)FormView1Ai.FindControl("ExtinguishersCheck_1");
            var chk1Fail = (CheckBox)FormView1Ai.FindControl("ExtinguishersCheck_1Fail");


            if (chk1.Checked)
            {
                chk1.Checked = true;
                e.NewValues["ExtinguishersCheck_1"] = chk1.Checked;
            }
            else
            {
                chk1.Checked = false;
                e.NewValues["ExtinguishersCheck_1"] = chk1.Checked;
            }

            var chk2 = (CheckBox)FormView1Ai.FindControl("ExtingushersLabel_2");

            if (chk2.Checked)
            {
                chk2.Checked = true;
                e.NewValues["ExtingushersLabel_2"] = chk2.Checked;
            }
            else
            {
                chk2.Checked = false;
                e.NewValues["ExtingushersLabel_2"] = chk2.Checked;
            }

            var chk3 = (CheckBox)FormView1Ai.FindControl("CompartmentsEmpty_3");

            if (chk3.Checked)
            {
                chk3.Checked = true;
                e.NewValues["CompartmentsEmpty_3"] = chk3.Checked;
            }
            else
            {
                chk3.Checked = false;
                e.NewValues["CompartmentsEmpty_3"] = chk3.Checked;
            }

            var chk4 = (CheckBox)FormView1Ai.FindControl("TyreCondition_4");

            if (chk4.Checked)
            {
                chk4.Checked = true;
                e.NewValues["TyreCondition_4"] = chk4.Checked;
            }
            else
            {
                chk4.Checked = false;
                e.NewValues["TyreCondition_4"] = chk4.Checked;
            }

            var chk5 = (CheckBox)FormView1Ai.FindControl("ExposedWires_5");

            if (chk5.Checked)
            {
                chk5.Checked = true;
                e.NewValues["ExposedWires_5"] = chk5.Checked;
            }
            else
            {
                chk5.Checked = false;
                e.NewValues["ExposedWires_5"] = chk5.Checked;
            }

            var chk6 = (CheckBox)FormView1Ai.FindControl("FunctionalBattery_6");

            if (chk6.Checked)
            {
                chk6.Checked = true;
                e.NewValues["FunctionalBattery_6"] = chk6.Checked;
            }
            else
            {
                chk6.Checked = false;
                e.NewValues["FunctionalBattery_6"] = chk6.Checked;
            }

            var chk7 = (CheckBox)FormView1Ai.FindControl("HandBrakeCondition_7");

            if (chk7.Checked)
            {
                chk7.Checked = true;
                e.NewValues["HandBrakeCondition_7"] = chk7.Checked;
            }
            else
            {
                chk7.Checked = false;
                e.NewValues["HandBrakeCondition_7"] = chk7.Checked;
            }

            var chk8 = (CheckBox)FormView1Ai.FindControl("BottomExhaustPipe_8");

            if (chk8.Checked)
            {
                chk8.Checked = true;
                e.NewValues["BottomExhaustPipe_8"] = chk8.Checked;
            }
            else
            {
                chk8.Checked = false;
                e.NewValues["BottomExhaustPipe_8"] = chk8.Checked;
            }

            var chk9 = (CheckBox)FormView1Ai.FindControl("ExhaustCondition_9");

            if (chk9.Checked)
            {
                chk9.Checked = true;
                e.NewValues["ExhaustCondition_9"] = chk9.Checked;
            }
            else
            {
                chk9.Checked = false;
                e.NewValues["ExhaustCondition_9"] = chk9.Checked;
            }

            var chk10 = (CheckBox)FormView1Ai.FindControl("FlameArrestorFitted_10");

            if (chk10.Checked)
            {
                chk10.Checked = true;
                e.NewValues["FlameArrestorFitted_10"] = chk10.Checked;
            }
            else
            {
                chk10.Checked = false;
                e.NewValues["FlameArrestorFitted_10"] = chk10.Checked;
            }

            var chk11 = (CheckBox)FormView1Ai.FindControl("SelfStart_11");

            if (chk11.Checked)
            {
                chk11.Checked = true;
                e.NewValues["SelfStart_11"] = chk11.Checked;
            }
            else
            {
                chk11.Checked = false;
                e.NewValues["SelfStart_11"] = chk11.Checked;
            }

            var chk12 = (CheckBox)FormView1Ai.FindControl("BatteryInsulated_12");

            if (chk12.Checked)
            {
                chk12.Checked = true;
                e.NewValues["BatteryInsulated_12"] = chk12.Checked;
            }
            else
            {
                chk12.Checked = false;
                e.NewValues["BatteryInsulated_12"] = chk12.Checked;
            }

            var chk13 = (CheckBox)FormView1Ai.FindControl("DashboardFree_13");

            if (chk13.Checked)
            {
                chk13.Checked = true;
                e.NewValues["DashboardFree_13"] = chk13.Checked;
            }
            else
            {
                chk13.Checked = false;
                e.NewValues["DashboardFree_13"] = chk13.Checked;
            }

            var chk14 = (CheckBox)FormView1Ai.FindControl("Earthingplate_14");

            if (chk14.Checked)
            {
                chk14.Checked = true;
                e.NewValues["Earthingplate_14"] = chk14.Checked;
            }
            else
            {
                chk14.Checked = false;
                e.NewValues["Earthingplate_14"] = chk14.Checked;
            }

            var chk15 = (CheckBox)FormView1Ai.FindControl("ValidCalibrationChart_15");

            if (chk15.Checked)
            {
                chk15.Checked = true;
                e.NewValues["ValidCalibrationChart_15"] = chk15.Checked;
            }
            else
            {
                chk15.Checked = false;
                e.NewValues["ValidCalibrationChart_15"] = chk15.Checked;
            }

            var chk16 = (CheckBox)FormView1Ai.FindControl("ContainersRemoved_16");

            if (chk16.Checked)
            {
                chk16.Checked = true;
                e.NewValues["ContainersRemoved_16"] = chk16.Checked;
            }
            else
            {
                chk16.Checked = false;
                e.NewValues["ContainersRemoved_16"] = chk16.Checked;
            }

            var chk17 = (CheckBox)FormView1Ai.FindControl("RegNo_Tally_OrderNo_17");

            if (chk17.Checked)
            {
                chk17.Checked = true;
                e.NewValues["RegNo_Tally_OrderNo_17"] = chk17.Checked;
            }
            else
            {
                chk17.Checked = false;
                e.NewValues["RegNo_Tally_OrderNo_17"] = chk17.Checked;
            }

            var chk18 = (CheckBox)FormView1Ai.FindControl("ProperSealing_18");

            if (chk18.Checked)
            {
                chk18.Checked = true;
                e.NewValues["ProperSealing_18"] = chk18.Checked;
            }
            else
            {
                chk18.Checked = false;
                e.NewValues["ProperSealing_18"] = chk18.Checked;
            }

            var chk19 = (CheckBox)FormView1Ai.FindControl("DangerPetroleumSign_20");

            if (chk19.Checked)
            {
                chk19.Checked = true;
                e.NewValues["DangerPetroleumSign_20"] = chk19.Checked;
            }
            else
            {
                chk19.Checked = false;
                e.NewValues["DangerPetroleumSign_20"] = chk19.Checked;
            }

            var chk20 = (CheckBox)FormView1Ai.FindControl("OilLeaking_21");

            if (chk20.Checked)
            {
                chk20.Checked = true;
                e.NewValues["OilLeaking_21"] = chk20.Checked;
            }
            else
            {
                chk20.Checked = false;
                e.NewValues["OilLeaking_21"] = chk20.Checked;
            }

            var chk21 = (CheckBox)FormView1Ai.FindControl("ValveCouplingComp_22");

            if (chk21.Checked)
            {
                chk21.Checked = true;
                e.NewValues["ValveCouplingComp_22"] = chk21.Checked;
            }
            else
            {
                chk21.Checked = false;
                e.NewValues["ValveCouplingComp_22"] = chk21.Checked;
            }

            var chk22 = (CheckBox)FormView1Ai.FindControl("BrokenLights_23");

            if (chk22.Checked)
            {
                chk22.Checked = true;
                e.NewValues["BrokenLights_23"] = chk22.Checked;
            }
            else
            {
                chk22.Checked = false;
                e.NewValues["BrokenLights_23"] = chk22.Checked;
            }

            var chk23 = (CheckBox)FormView1Ai.FindControl("KEN_Number_24");

            if (chk23.Checked)
            {
                chk23.Checked = true;
                e.NewValues["KEN_Number_24"] = chk23.Checked;
            }
            else
            {
                chk23.Checked = false;
                e.NewValues["KEN_Number_24"] = chk23.Checked;
            }

            var chk24 = (CheckBox)FormView1Ai.FindControl("TruckLadderSpace_25");

            if (chk24.Checked)
            {
                chk24.Checked = true;
                e.NewValues["TruckLadderSpace_25"] = chk24.Checked;
            }
            else
            {
                chk24.Checked = false;
                e.NewValues["TruckLadderSpace_25"] = chk24.Checked;
            }

            var chk25 = (CheckBox)FormView1Ai.FindControl("WheelChokesChaned_26");

            if (chk25.Checked)
            {
                chk25.Checked = true;
                e.NewValues["WheelChokesChaned_26"] = chk25.Checked;
            }
            else
            {
                chk25.Checked = false;
                e.NewValues["WheelChokesChaned_26"] = chk25.Checked;
            }
        }
Пример #43
0
 protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     Session["Brand"] = ((DropDownList)FormView1.FindControl("ddlBrand")).SelectedValue;
 }
Пример #44
0
 protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     e.NewValues["InputPerson"] = base.user.UserCode;
     e.Cancel = InvalidInput();
 }
Пример #45
0
    protected void fvProperty_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        TextBox      tbAddress1    = fvProperty.FindControl("tbAddress1") as TextBox;
        TextBox      tbAddress2    = fvProperty.FindControl("tbAddress2") as TextBox;
        DropDownList ddlState      = fvProperty.FindControl("ddlState") as DropDownList;
        DropDownList ddlZip        = fvProperty.FindControl("ddlZip") as DropDownList;
        TextBox      tbCity        = fvProperty.FindControl("tbCity") as TextBox;
        TextBox      tbZip4        = fvProperty.FindControl("tbZip4") as TextBox;
        DropDownList ddlCountyNY   = fvProperty.FindControl("ddlCounty") as DropDownList;
        DropDownList ddlTownshipNY = fvProperty.FindControl("ddlTownshipNY") as DropDownList;
        DropDownList ddlBasin      = fvProperty.FindControl("ddlBasin") as DropDownList;
        DropDownList ddlSubbasin   = fvProperty.FindControl("ddlSubbasin") as DropDownList;

        using (WACDataClassesDataContext wDataContext = new WACDataClassesDataContext())
        {
            try
            {
                var a = wDataContext.properties.Where(w => w.pk_property == Convert.ToInt32(fvProperty.DataKey.Value)).Select(s => s).Single();

                a.address  = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbAddress1.Text, 100).Trim();
                a.address2 = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbAddress2.Text, 48).Trim();
                a.city     = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbCity.Text, 48).Trim();
                if (!string.IsNullOrEmpty(ddlState.SelectedValue))
                {
                    a.state = ddlState.SelectedValue;
                }
                else
                {
                    a.state = null;
                }
                if (!string.IsNullOrEmpty(ddlZip.SelectedValue))
                {
                    a.fk_zipcode = ddlZip.SelectedValue;
                }
                else
                {
                    a.fk_zipcode = null;
                }
                a.zip4 = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbZip4.Text, 4).Trim();
                if (!string.IsNullOrEmpty(ddlCountyNY.SelectedValue))
                {
                    a.fk_list_countyNY = Convert.ToInt32(ddlCountyNY.SelectedValue);
                }
                else
                {
                    a.fk_list_countyNY = null;
                }
                if (!string.IsNullOrEmpty(ddlTownshipNY.SelectedValue))
                {
                    a.fk_list_townshipNY = Convert.ToInt32(ddlTownshipNY.SelectedValue);
                }
                else
                {
                    a.fk_list_townshipNY = null;
                }
                if (!string.IsNullOrEmpty(ddlBasin.SelectedValue))
                {
                    a.fk_basin_code = ddlBasin.SelectedValue;
                }
                else
                {
                    a.fk_basin_code = null;
                }
                if (!string.IsNullOrEmpty(ddlSubbasin.SelectedValue))
                {
                    a.fk_subbasin_code = ddlSubbasin.SelectedValue;
                }
                else
                {
                    a.fk_subbasin_code = null;
                }

                a.modified    = DateTime.Now;
                a.modified_by = Session["userName"].ToString();
                wDataContext.SubmitChanges();
                fvProperty.ChangeMode(FormViewMode.ReadOnly);
                BindProperty(Convert.ToInt32(fvProperty.DataKey.Value));
            }
            catch (Exception ex) { WACAlert.Show(ex.Message, 0); }
        }
    }
Пример #46
0
 protected void grdvEAP_RowUpdating(Object sender, FormViewUpdateEventArgs e)
 {
     updateAudit(e);
 }
Пример #47
0
    protected void fvAg_WFP3_Encumbrance_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        StringBuilder sb = new StringBuilder();

        FormView fv = fvAg_WFP3_Encumbrance;

        DropDownList ddlEncumbrance        = fv.FindControl("ddlEncumbrance") as DropDownList;
        CustomControls_AjaxCalendar ecDate = fv.FindControl("tbCalEncumbranceDate") as CustomControls_AjaxCalendar;
        DropDownList ddlType  = fv.FindControl("ddlType") as DropDownList;
        TextBox      tbAmount = fv.FindControl("tbAmount") as TextBox;
        CustomControls_AjaxCalendar approvedDate = fv.FindControl("tbCalEncumbranceApprovedDate") as CustomControls_AjaxCalendar;
        TextBox tbNote = fv.FindControl("tbNote") as TextBox;

        using (WACDataClassesDataContext wDataContext = new WACDataClassesDataContext())
        {
            var a = wDataContext.form_wfp3_encumbrances.Where(w => w.pk_form_wfp3_encumbrance == Convert.ToInt32(fv.DataKey.Value)).Select(s => s).Single();
            try
            {
                if (!string.IsNullOrEmpty(ddlEncumbrance.SelectedValue))
                {
                    a.fk_encumbrance_code = ddlEncumbrance.SelectedValue;
                }
                else
                {
                    sb.Append("Encumbrance was not updated. Encumbrance is required. ");
                }

                DateTime?dt = ecDate.CalDateNullable;
                if (dt == null)
                {
                    sb.Append("Date was not updated. Date is required. ");
                }
                else
                {
                    a.date = (DateTime)ecDate.CalDateNullable;
                }

                if (!string.IsNullOrEmpty(ddlType.SelectedValue))
                {
                    a.fk_encumbranceType_code = ddlType.SelectedValue;
                }
                else
                {
                    a.fk_encumbranceType_code = null;
                }

                if (!string.IsNullOrEmpty(tbAmount.Text))
                {
                    try { a.amt = Convert.ToDecimal(tbAmount.Text); }
                    catch { sb.Append("Amount was not updated. Must be a number (Decimal). "); }
                }
                else
                {
                    sb.Append("Amount was not updated. Amount is required. ");
                }

                a.approved = approvedDate.CalDateNullable;

                if (!string.IsNullOrEmpty(tbNote.Text))
                {
                    a.note = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbNote.Text, 255);
                }
                else
                {
                    a.note = null;
                }

                a.modified    = DateTime.Now;
                a.modified_by = Session["userName"].ToString();

                wDataContext.SubmitChanges();

                if (!string.IsNullOrEmpty(sb.ToString()))
                {
                    WACAlert.Show(sb.ToString(), 0);
                }
            }
            catch (Exception ex) { WACAlert.Show(ex.Message, 0); }
        }
    }
Пример #48
0
 protected void FvDriverView_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     FvDriverView_CallInsertOrUpdate("Update");
 }
Пример #49
0
 void dv_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     dataUpdating = true;
 }
Пример #50
0
    protected void fvAg_WFP3_Payment_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        FormView fv = fvAg_WFP3_Payment;

        DropDownList ddlPayee   = fv.FindControl("ddlPayee") as DropDownList;
        DropDownList ddlInvoice = fv.FindControl("ddlInvoice") as DropDownList;
        CustomControls_AjaxCalendar tbCalPaymentDate = fv.FindControl("tbCalPaymentDate") as CustomControls_AjaxCalendar;
        TextBox      tbCheckNumber  = fv.FindControl("tbCheckNumber") as TextBox;
        DropDownList ddlEncumbrance = fv.FindControl("ddlEncumbrance") as DropDownList;
        //DropDownList ddlIsContractor = fv.FindControl("ddlIsContractor") as DropDownList;
        //DropDownList ddlFlood2006 = fv.FindControl("ddlFlood2006") as DropDownList;
        TextBox tbNote = fv.FindControl("tbNote") as TextBox;

        StringBuilder sb = new StringBuilder();

        using (WACDataClassesDataContext wDataContext = new WACDataClassesDataContext())
        {
            var a = (from b in wDataContext.form_wfp3_payments.Where(w => w.pk_form_wfp3_payment == Convert.ToInt32(fv.DataKey.Value))
                     select b).Single();
            try
            {
                if (!string.IsNullOrEmpty(ddlPayee.SelectedValue))
                {
                    a.fk_participant_payee = Convert.ToInt32(ddlPayee.SelectedValue);
                }
                else
                {
                    sb.Append("Payee was not updated. This is a required field. ");
                }

                if (!string.IsNullOrEmpty(ddlInvoice.SelectedValue))
                {
                    a.fk_form_wfp3_invoice = Convert.ToInt32(ddlInvoice.SelectedValue);
                }
                else
                {
                    a.fk_form_wfp3_invoice = null;
                }

                a.date = (DateTime)tbCalPaymentDate.CalDateNullable;

                if (!string.IsNullOrEmpty(tbCheckNumber.Text))
                {
                    a.check_nbr = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbCheckNumber.Text, 16);
                }
                else
                {
                    sb.Append("Check Number was not updated. This is a required field. ");
                }

                if (!string.IsNullOrEmpty(ddlEncumbrance.SelectedValue))
                {
                    a.fk_encumbrance_code = ddlEncumbrance.SelectedValue;
                }
                else
                {
                    sb.Append("Encumbrance was not updated. This is a required field. ");
                }

                //if (!string.IsNullOrEmpty(ddlIsContractor.SelectedValue)) a.is_contractor = ddlIsContractor.SelectedValue;
                //else a.is_contractor = null;

                //if (!string.IsNullOrEmpty(ddlFlood2006.SelectedValue)) a.flood_2006 = ddlFlood2006.SelectedValue;
                //else a.flood_2006 = null;

                a.note = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbNote.Text, 400);

                a.modified    = DateTime.Now;
                a.modified_by = Session["userName"].ToString();

                wDataContext.SubmitChanges();

                if (!string.IsNullOrEmpty(sb.ToString()))
                {
                    WACAlert.Show(sb.ToString(), 0);
                }
            }
            catch (Exception ex) { WACAlert.Show(ex.Message, 0); }
        }
    }
Пример #51
0
 protected void FvQualificationMaster_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     Global.SetFormViewParameters(e.NewValues, Employee.GetQualificationRow());
 }
Пример #52
0
    protected void fvHR_WACEmployee_Evaluation_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        int iCode = 0;

        PK_ParticipantEval = Convert.ToInt32(fvHR_WACEmployee_Evaluation.DataKey.Value);
        TextBox      tbDate            = fvHR_WACEmployee_Evaluation.FindControl("AjaxCalendar_Date").FindControl("tb") as TextBox;
        TextBox      tbFollowUpDate    = fvHR_WACEmployee_Evaluation.FindControl("AjaxCalendar_FollowUpDate").FindControl("tb") as TextBox;
        TextBox      tbRating          = fvHR_WACEmployee_Evaluation.FindControl("tbRating") as TextBox;
        DropDownList ddlSixMonthEval   = fvHR_WACEmployee_Evaluation.FindControl("ddlSixMonthEval") as DropDownList;
        DropDownList ddlAnnualEval     = fvHR_WACEmployee_Evaluation.FindControl("ddlAnnualEval") as DropDownList;
        DropDownList ddlFiscalYear     = fvHR_WACEmployee_Evaluation.FindControl("ddlFiscalYear") as DropDownList;
        DropDownList ddlPosition       = fvHR_WACEmployee_Evaluation.FindControl("ddlPosition") as DropDownList;
        DropDownList ddlJobDescription = fvHR_WACEmployee_Evaluation.FindControl("ddlJobDescription") as DropDownList;
        TextBox      tbNote            = fvHR_WACEmployee_Evaluation.FindControl("tbNote") as TextBox;
        TextBox      tbFollowUpNote    = fvHR_WACEmployee_Evaluation.FindControl("tbFollowUpNote") as TextBox;

        using (WACDataClassesDataContext wac = new WACDataClassesDataContext())
        {
            try
            {
                DateTime?dtDate = null;
                try { dtDate = Convert.ToDateTime(tbDate.Text); }
                catch { throw new Exception("Evaluation Date missing or Invalid "); }

                DateTime?dtFollowUpDate = null;
                try { dtFollowUpDate = Convert.ToDateTime(tbFollowUpDate.Text); }
                catch { }

                int?iRating = SafeIntFromText(tbRating.Text);

                string sSixMonthEval = null;
                if (!string.IsNullOrEmpty(ddlSixMonthEval.SelectedValue))
                {
                    sSixMonthEval = ddlSixMonthEval.SelectedValue;
                }

                string sAnnualEval = null;
                if (!string.IsNullOrEmpty(ddlAnnualEval.SelectedValue))
                {
                    sAnnualEval = ddlAnnualEval.SelectedValue;
                }

                string sFK_positionWAC = null;
                if (!string.IsNullOrEmpty(ddlPosition.SelectedValue))
                {
                    sFK_positionWAC = ddlPosition.SelectedValue;
                }
                else
                {
                    throw new Exception("Position is required. ");
                }

                string sFK_fiscalYear = null;
                if (!string.IsNullOrEmpty(ddlFiscalYear.SelectedValue))
                {
                    sFK_fiscalYear = ddlFiscalYear.SelectedValue;
                }
                else
                {
                    throw new Exception("Fiscal Year is required. ");
                }

                string sJobDescription = null;
                if (!string.IsNullOrEmpty(ddlJobDescription.SelectedValue))
                {
                    sJobDescription = ddlJobDescription.SelectedValue;
                }

                string sNote = null;
                if (!string.IsNullOrEmpty(tbNote.Text))
                {
                    sNote = tbNote.Text;
                }

                string sFollowUpNote = null;
                if (!string.IsNullOrEmpty(tbFollowUpNote.Text))
                {
                    sFollowUpNote = tbFollowUpNote.Text;
                }

                iCode = wac.participantWAC_evaluation_update(PK_ParticipantEval, sFK_fiscalYear, sFK_positionWAC, dtDate, iRating, sSixMonthEval,
                                                             sAnnualEval, dtFollowUpDate, sFollowUpNote, sNote, sJobDescription, Session["userName"].ToString());
                if (iCode == 0)
                {
                    fvHR_WACEmployee_Evaluation.ChangeMode(FormViewMode.ReadOnly);
                    BindHR_WACEmployee_Evaluation();
                    OnFormActionCompleted(this, new FormViewEventArgs(FK_ParticipantWAC, "evaluation"));
                }
                else
                {
                    WACAlert.Show("", iCode);
                }
            }
            catch (Exception ex) { WACAlert.Show("Error: " + ex.Message, 0); }
        }
    }
Пример #53
0
 protected void FvOutward_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     Global.SetFormViewParameters(e.NewValues, new IGRSS.DataAccessLayer.Outward.OutwardRegisterDataTable().NewOutwardRegisterRow());
 }
 protected void FvOfficeCommunication_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     Global.SetFormViewParameters(e.NewValues, OfficeCommunicationLKP.GetOfficeCommunicationRow());
 }
Пример #55
0
    protected void fvVenue_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
        TextBox      tbLocation   = fvVenue.FindControl("tbLocation") as TextBox;
        TextBox      tbNote       = fvVenue.FindControl("tbNote") as TextBox;
        DropDownList ddlPhone     = fvVenue.FindControl("UC_Communication_EditInsert_Phone").FindControl("ddlNumber") as DropDownList;
        DropDownList ddlFax       = fvVenue.FindControl("UC_Communication_EditInsert_Fax").FindControl("ddlNumber") as DropDownList;
        TextBox      tbEmail      = fvVenue.FindControl("tbEmail") as TextBox;
        HiddenField  hfPropertyPK = fvVenue.FindControl("UC_Property_EditInsert1").FindControl("hfPropertyPK") as HiddenField;

        StringBuilder sb = new StringBuilder();

        using (WACDataClassesDataContext wDataContext = new WACDataClassesDataContext())
        {
            var a = (from b in wDataContext.eventVenues.Where(w => w.pk_eventVenue == Convert.ToInt32(fvVenue.DataKey.Value)) select b).Single();

            if (!string.IsNullOrEmpty(tbLocation.Text))
            {
                a.location = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbLocation.Text, 48).Trim();
            }
            else
            {
                sb.Append("Location was not updated. This is a required field. ");
            }

            if (!string.IsNullOrEmpty(ddlPhone.SelectedValue))
            {
                a.fk_communication_phone = Convert.ToInt32(ddlPhone.SelectedValue);
            }
            else
            {
                a.fk_communication_phone = null;
            }

            if (!string.IsNullOrEmpty(ddlFax.SelectedValue))
            {
                a.fk_communication_fax = Convert.ToInt32(ddlFax.SelectedValue);
            }
            else
            {
                a.fk_communication_fax = null;
            }

            a.email = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbEmail.Text, 48).Trim();

            a.note = WACGlobal_Methods.Format_Global_StringLengthRestriction(tbNote.Text, 255).Trim();

            if (!string.IsNullOrEmpty(hfPropertyPK.Value))
            {
                a.fk_property = Convert.ToInt32(hfPropertyPK.Value);
            }
            else
            {
                a.fk_property = null;
            }

            a.modified    = DateTime.Now;
            a.modified_by = Session["userName"].ToString();

            try
            {
                wDataContext.SubmitChanges();
                fvVenue.ChangeMode(FormViewMode.ReadOnly);
                BindVenue(Convert.ToInt32(fvVenue.DataKey.Value));

                if (!string.IsNullOrEmpty(sb.ToString()))
                {
                    WACAlert.Show(sb.ToString(), 0);
                }
            }
            catch (Exception ex) { WACAlert.Show(ex.Message, 0); }
        }
    }
Пример #56
0
 protected void FormViewSeminar_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     Session["Date"] = DateTime.Parse(((TextBox)FormViewSeminar.FindControl("seminarDateTextBox")).Text);
 }
Пример #57
0
 protected void fvLeave_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     Global.SetFormViewParameters(e.NewValues, Leave.GetRow());
 }
Пример #58
0
 protected void frmViewAdd_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
 }
Пример #59
0
 protected void fvcomplain_ItemUpdating(object sender, FormViewUpdateEventArgs e)
 {
     e.NewValues.Add("ComplainingEmpID", (Guid)Membership.GetUser().ProviderUserKey);
     Global.SetFormViewParameters(e.NewValues, Complain.GetComplainRow());
 }
Пример #60
0
        protected void ctlExchangeForm_ItemUpdating(object sender, FormViewUpdateEventArgs e)
        {
            short exchangeRateId = Convert.ToInt16(ctlExchangeForm.DataKey.Value);

            //modify by tom 28/01/2009
            //SCG.eAccounting.Web.UserControls.Calendar ctlFromDateCalendar = ctlExchangeForm.FindControl("Calendar1") as SCG.eAccounting.Web.UserControls.Calendar;
            //SCG.eAccounting.Web.UserControls.Calendar ctlToDateCalendar = ctlExchangeForm.FindControl("Calendar2") as SCG.eAccounting.Web.UserControls.Calendar;
            UserControls.Calendar ctlFromDateCalendar = ctlExchangeForm.FindControl("Calendar1") as UserControls.Calendar;
            UserControls.Calendar ctlToDateCalendar   = ctlExchangeForm.FindControl("Calendar2") as UserControls.Calendar;
            TextBox        ctlFromDate  = ctlFromDateCalendar.FindControl("txtDate") as TextBox;
            TextBox        ctlToDate    = ctlToDateCalendar.FindControl("txtDate") as TextBox;
            TextBox        ctlBuyRate   = (TextBox)ctlExchangeForm.FindControl("ctlBuyRate");
            TextBox        ctlSellRate  = (TextBox)ctlExchangeForm.FindControl("ctlSellRate");
            TextBox        ctlComment   = (TextBox)ctlExchangeForm.FindControl("ctlComment");
            CheckBox       ctlActiveChk = (CheckBox)ctlExchangeForm.FindControl("ctlActiveChk");
            DateTime       NewDate      = new DateTime();
            float          newFloat     = new float();
            DbExchangeRate exchangeRate = DbExchangeRateService.FindByIdentity(exchangeRateId);

            if (!string.IsNullOrEmpty(ctlFromDate.Text))
            {
                //exchangeRate.FromDate = UIHelper.ParseDate(ctlFromDateCalendar.DateValue, UserCulture).Value; //UIHelper.ParseDate("12-Jan-2009").Value;
            }
            else
            {
                exchangeRate.FromDate = NewDate;
            }
            if (!string.IsNullOrEmpty(ctlToDate.Text))
            {
                //exchangeRate.ToDate = UIHelper.ParseDate(ctlToDateCalendar.DateValue, UserCulture).Value; //UIHelper.ParseDate("12-Jan-2009").Value;
            }
            else
            {
                exchangeRate.ToDate = NewDate;
            }
            if (!string.IsNullOrEmpty(ctlBuyRate.Text))
            {
                try
                {
                    exchangeRate.BuyRate = Convert.ToSingle(ctlBuyRate.Text);
                }
                catch (FormatException)
                {
                    ValidationErrors.AddError("Currency.Error", new Spring.Validation.ErrorMessage("BuyrateFormat"));
                }
            }
            else
            {
                exchangeRate.BuyRate = newFloat;
            }
            if (!string.IsNullOrEmpty(ctlSellRate.Text))
            {
                try
                {
                    exchangeRate.SellRate = Convert.ToSingle(ctlSellRate.Text);
                }
                catch (FormatException)
                {
                    ValidationErrors.AddError("Currency.Error", new Spring.Validation.ErrorMessage("SellrateFormat"));
                }
            }
            else
            {
                exchangeRate.SellRate = newFloat;
            }
            exchangeRate.Comment = ctlComment.Text;
            exchangeRate.Active  = ctlActiveChk.Checked;
            exchangeRate.UpdBy   = UserAccount.UserID;
            exchangeRate.UpdDate = DateTime.Now;
            exchangeRate.UpdPgm  = ProgramCode;
            try
            {
                DbExchangeRateService.UpdateExchangeRate(exchangeRate);
                ctlExchangeGrid.DataCountAndBind();
                ctlExchangeForm.ChangeMode(FormViewMode.ReadOnly);
                CloseExchangePopUp();
            }
            catch (ServiceValidationException ex)
            {
                ValidationErrors.MergeErrors(ex.ValidationErrors);
            }
        }