Exemple #1
0
        /// <summary>
        /// Function for filling independent drop down.
        /// </summary>
        private void FillIndependentCombo()
        {
            DT = new DataTable();
            if (pk_Institute_ID != string.Empty)
            {
                DT = oInst.AssignedConfirmedFaculties(Convert.ToString(UniId), pk_Institute_ID);
            }
            else
            {
                DT = oCr.LaunchedUniversityWiseFacultyList(UniId);
            }


            oCommon = new clsCommon();
            oCommon.fillDropDown(DDlFaculty, DT, string.Empty, "Fac_Desc", "pk_Fac_ID", "---- Select ----");
            if (oCommon != null)
            {
                oCommon = null;
            }

            DT       = new DataTable();
            oGeneral = new clsGeneral();
            DT       = oGeneral.ListGender();
            oGeneral = null;
            oCommon  = new clsCommon();
            oCommon.fillDropDown(DD_Gender, DT, "0", "Text", "Value", "---- Select ----");
            DT      = null;
            oCommon = null;
        }
 internal void TestSQL(SqlConnection myConn, clsGeneral.clsGeneral Gen, string ConnString)
 {
     General = Gen;
     richTextBox1.Text = Gen.textTestSQL;
     tstConn = myConn;
     tstConnString = ConnString;
 }
        //Chip Repuesto Postpago
        public ArrayList ConsultarListaPreciosMaestro(string p_codigo_articulo, string p_codigo_campana, string p_fecha_Venta,
                                                      string p_tipo_operacion, string p_tipo_Venta)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarListaPreciosMaestro(p_codigo_articulo, p_codigo_campana, p_fecha_Venta, p_tipo_operacion, p_tipo_Venta));
        }
        public ArrayList ConsultarListaPreciosRP(string p_tipo_venta, string p_plan_tarif, string p_codigo_material, string p_codigo_campania,
                                                 string p_org_venta, string p_fecha, string p_tipo_operacion)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarListaPreciosRP(p_tipo_venta, p_plan_tarif, p_codigo_material, p_codigo_campania,
                                               p_org_venta, p_fecha, p_tipo_operacion));
        }
        public void ConsultarUbigeo(string p_ubigeo, out string dep_cod, out string dep_desc, out string prov_cod, out string prov_desc,
                                    out string dist_cod, out string dist_desc, out string codigo_postal)
        {
            clsGeneral obj = new clsGeneral();

            obj.ConsultarUbigeo(p_ubigeo, out dep_cod, out dep_desc, out prov_cod, out prov_desc, out dist_cod, out dist_desc,
                                out codigo_postal);
        }
        public ArrayList ConsultarLPrecio(string p_canal, string p_tipo_doc_venta, string p_tipo_venta, string p_plan_tarif, string p_codigo_material, string p_codigo_campania,
                                          string p_org_venta, string p_fecha, string p_tipo_operacion, string p_plazo_acuerdo, string p_oficina)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarLPrecio(p_canal, p_tipo_doc_venta, p_tipo_venta, p_plan_tarif, p_codigo_material, p_codigo_campania,
                                        p_org_venta, p_fecha, p_tipo_operacion, p_plazo_acuerdo, p_oficina));
        }
Exemple #7
0
        private void AddProject()
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();
            clsSchedule Schedule = new clsSchedule();
            Project Project = new Project();

            System.Globalization.CultureInfo dateFormat = new System.Globalization.CultureInfo("en-US", true);
            DateTime estStartDate = new DateTime();
            DateTime estCompletionDate = new DateTime();
            decimal feeAmount = default(decimal);
            int pic = 0;
            string picCode = string.Empty;
            int pm = 0;
            string pmCode = string.Empty;

            if (!string.IsNullOrEmpty(txtEstStartOfConstruction.Text))
            {
                estStartDate = DateTime.Parse(txtEstStartOfConstruction.Text,  dateFormat);
                //strSQL += "'" & CleanString(basToolbox.Nz(txtEstStartOfConstruction.Text, "")) & "', "
                //Else
                //strSQL += "NULL, "
            }
            if (!string.IsNullOrEmpty(txtEstCompletionOfConstruction.Text))
            {
                estCompletionDate = DateTime.Parse(txtEstCompletionOfConstruction.Text, dateFormat);
                //strSQL += "'" & CleanString(basToolbox.Nz(txtEstCompletionOfConstruction.Text, "")) & "', "
                //Else
                //strSQL += "NULL, "
            }
            if (!string.IsNullOrEmpty(txtFeeAmount.Text))
            {
                decimal.TryParse(txtFeeAmount.Text.Replace("$", "").Replace(",", ""), out feeAmount);
            }

            pic = Convert.ToInt32(cboPIC.SelectedValue);
            if (!(pic == 0))
            {
                picCode = Schedule.GetEmployeeCode(pic);
            }
            pm = Convert.ToInt32(cboPM.SelectedValue);
            if (!(pm == 0))
            {
                pmCode = Schedule.GetEmployeeCode(pm);
                //strSQL += Zz(cboPM.SelectedValue, 0) & ", "
                //strSQL += "'" & Schedule.GetEmployeeCode(Zz(cboPM.SelectedValue, 0)) & "')"
                //Else
                //strSQL += "NULL, NULL)"
            }

            Project.CreateNewProject(Convert.ToDecimal(txtProjectNo.Text), txtProjectName.Text, Convert.ToInt32(cboClientName.SelectedValue), txtProjectLocation.Text, txtConstructionType.Text, txtProjectType.Text, Convert.ToInt32(cboPhase.SelectedValue), estStartDate, estCompletionDate, feeAmount,
            cboFeeStructure.SelectedValue, txtRemarks.Text, pic, picCode, pm, pmCode, EmployeeID);

            //General.FillDataset(strSQL)
        }
Exemple #8
0
        protected void btnLogin_Click(object sender, System.EventArgs e)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            if (!ValidateForm())
                return;

            //Validate Account Exists
            strSQL = "SELECT tblUsers.UserLevel, tblUsers.EmployeeID, tblEmployees.EmployeeFirst, tblEmployees.EmployeeLast ";
            strSQL += "FROM tblEmployees INNER JOIN ";
            strSQL += "tblUsers ON tblEmployees.EmployeeID = tblUsers.EmployeeID ";
            strSQL += "WHERE (tblUsers.UserName = '******') ";
            strSQL += "AND (tblUsers.Password = '******') ";

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0)
            {
                Session["UserLevel"] = dt.Rows[0]["UserLevel"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["UserLevel"], "");
                Session["EmployeeID"] = dt.Rows[0]["EmployeeID"].GetValueOrDefault<int>();
                Session["UserName"] = dt.Rows[0]["EmployeeFirst"].GetValueOrDefault<string>() + " " + dt.Rows[0]["EmployeeLast"].GetValueOrDefault<string>();
            }
            else
            {
                lblError.Text = "Invalid login.";
                lblError.Visible = true;
            }

            ds.Dispose();
            ds = null;
            dt.Dispose();
            dt = null;

            if (cbRememberMe.Checked)
            {
                Response.Cookies["KPFFAuthorization"]["Login"] = txtUserName.Text;
                Response.Cookies["KPFFAuthorization"]["Password"] = txtPassword.Text;
                Response.Cookies["KPFFAuthorization"].Expires = DateTime.Now.AddDays(10);
            }
            else
            {
                Response.Cookies["KPFFAuthorization"].Expires = DateTime.Now.AddDays(-1);
            }

            if (Session["UserLevel"].GetValueOrDefault<string>() == "Admin")
            {
                Response.Redirect("MyAdmin/Clients.aspx");
            }
            else if (Session["UserLevel"].GetValueOrDefault<string>() == "User")
            {
                Response.Redirect("MyAccount/MyProjects.aspx");
            }
        }
        public DataSet ConsultarPrecio(string p_oficina, string p_documento_origen, string p_consecutivo, string p_material,
                                       string p_utilizacion, decimal p_cantidad, string p_fecha, string p_serie, string p_nro_telefono, string p_tipo_doc_venta,
                                       string p_cadena_series, string p_canal, string p_org_vnt, string p_disp_IMEI, out decimal p_descuento, out decimal p_prec_incIGV,
                                       out decimal p_precio, out decimal p_subTotal)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarPrecio(p_oficina, p_documento_origen, p_consecutivo, p_material, p_utilizacion, p_cantidad, p_fecha, p_serie,
                                       p_nro_telefono, p_tipo_doc_venta, p_cadena_series, p_canal, p_org_vnt, p_disp_IMEI, out p_descuento, out p_prec_incIGV,
                                       out p_precio, out p_subTotal));
        }
        public bool RealizarPedido(string CadenaCabecera, string CadenaDetalle, string CadenaSeries,
                                   string CadenaServAdic, string CadenaAcuerdo, out string strEntrega, out string strFactura,
                                   out string strNroContrato, out string strNroDocCliente, out string strNroPedido,
                                   out string strRefHistorico, out string strTipDocCliente, out decimal dblValorDescuento)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.RealizarPedido(CadenaCabecera, CadenaDetalle, CadenaSeries, CadenaServAdic, CadenaAcuerdo,
                                      out strEntrega, out strFactura, out strNroContrato, out strNroDocCliente, out strNroPedido,
                                      out strRefHistorico, out strTipDocCliente, out dblValorDescuento));
        }
Exemple #11
0
        protected void dgEmployees_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();
            int intEmployeeID = e.Keys[0].GetValueOrDefault<int>();

            if (!(intEmployeeID == 0))
            {
                //Check to see if Child records exist
                strSQL = "DELETE FROM tblSchedule ";
                strSQL += "WHERE EmployeeID = " + intEmployeeID;
                General.DeleteRecord(strSQL);
            }
        }
Exemple #12
0
        public void UpdateEmployee()
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();
            int intEmployeeID = Convert.ToInt32(Request.Params["EmployeeId"]);

            strSQL = "UPDATE tblEmployees ";
            strSQL += "SET UserName = '******' ";
            strSQL += "WHERE intEmployeeID = " + intEmployeeID;

            General.UpdateRecord(strSQL);

            lblError.Text = "Employee Updated!";
            lblError.Visible = true;
        }
Exemple #13
0
        private void AddUpdateUser(int intEmployeeID)
        {
            clsGeneral General = new clsGeneral();
            bool blnUserExists = false;

            //Check to see if User Account Exists
            strSQL = "SELECT ID ";
            strSQL += "FROM tblUsers ";
            strSQL += "WHERE EmployeeID = " + intEmployeeID;

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0)
            {
                blnUserExists = true;
            }
            else
            {
                blnUserExists = false;
            }

            ds.Dispose();
            ds = null;
            dt.Dispose();
            dt = null;

            if (blnUserExists == true)
            {
                strSQL = "UPDATE tblUsers ";
                strSQL += "SET ";
                strSQL += "UserName = '******', ";
                strSQL += "Password = '******' ";
                strSQL += "WHERE EmployeeID = " + intEmployeeID;
                General.UpdateRecord(strSQL);
            }
            else
            {
                strSQL = "INSERT INTO tblUsers ";
                strSQL += "(UserName, Password, UserLevel, EmployeeID) ";
                strSQL += "VALUES ( ";
                strSQL += "'" + txtUserName.Text + "', ";
                strSQL += "'" + txtPassword.Text + "', ";
                strSQL += "'User', ";
                strSQL += intEmployeeID + ")";
                General.AddRecord(strSQL);
            }
        }
Exemple #14
0
        private void PopulateEmployeeType()
        {
            int intUserID = Convert.ToInt32(Request.Params["UserID"]);
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT * ";
            strSQL += "FROM tblEmployeeTypes ";

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];
            DataView dv = new DataView(dt);

            cboEmployeeType.DataTextField = "EmployeeType";
            cboEmployeeType.DataValueField = "id";
            cboEmployeeType.DataSource = dv;
            cboEmployeeType.DataBind();
        }
Exemple #15
0
        private void PopulateForm()
        {
            int intEmployeeId = Convert.ToInt32(Request.Params["EmployeeId"]);
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            intEmployeeId = 1;

            strSQL = "SELECT * ";
            strSQL += "FROM tblEmployees ";
            strSQL += "WHERE EmployeeID = " + intEmployeeId;

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0)
            {
                txtEmployeeName.Text = dt.Rows[0]["EmployeeName"].GetValueOrDefault<string>();
                cboEmployeeType.Items.FindByText(dt.Rows[0]["EmployeeType"].GetValueOrDefault<string>()).Selected = true;
                txtAddress.Text = dt.Rows[0]["Address"].GetValueOrDefault<string>();
                txtCity.Text = dt.Rows[0]["City"].GetValueOrDefault<string>();
                if (!string.IsNullOrEmpty(dt.Rows[0]["State"].GetValueOrDefault<string>()))
                {
                    cboState.Items.FindByText(dt.Rows[0]["State"].GetValueOrDefault<string>()).Selected = true;
                }
                txtZip.Text = dt.Rows[0]["Zip"].GetValueOrDefault<string>();
                txtHomePhone.Text = dt.Rows[0]["HomePhone"].GetValueOrDefault<string>();
                txtCellPhone.Text = dt.Rows[0]["CellPhone"].GetValueOrDefault<string>();
                txtComments.Text = dt.Rows[0]["Comments"].GetValueOrDefault<string>();
                //rbtnList.Text = Zz(dt.Rows[0]["EmployeeName"), "")
            }
            else
            {
                lblError.Text = "Employee does not exist.";
                lblError.Visible = true;
            }

            dt.Dispose();
            ds.Dispose();
            dt = null;
            ds = null;
        }
Exemple #16
0
        private void PopulateCombos()
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT * FROM tblClientTypes ";

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];
            DataView dv = dt.DefaultView;
            dv.Sort = "ID";

            cboClientType.DataSource = dv;
            cboClientType.DataTextField = "ClientType";
            cboClientType.DataValueField = "ID";
            cboClientType.DataBind();

            dt.Dispose();
            dt = null;
            ds.Dispose();
            ds = null;
        }
Exemple #17
0
        public object GetTotalRecords()
        {
            int intTotalRecords = 0;
            clsGeneral General = new clsGeneral();
            string strSQL = "";

            strSQL = "SELECT tblEmployees.EmployeeID ";
            strSQL += "FROM tblEmployees LEFT OUTER JOIN tblEmployeeTypes ON tblEmployees.EmployeeTypeID = tblEmployeeTypes.ID ";
            strSQL += "ORDER BY tblEmployees.EmployeeCode";

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            intTotalRecords = dt.Rows.Count;

            ds.Dispose();
            ds = null;
            dt.Dispose();
            dt = null;

            return intTotalRecords;
        }
Exemple #18
0
        private void PopulateForm(int intClientID)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT * FROM tblClients ";
            strSQL += "WHERE ID = " + intClientID;

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0)
            {
                txtClientName.Text = dt.Rows[0]["ClientName"].GetValueOrDefault<string>();
                cboClientType.SelectedValue = dt.Rows[0]["ClientTypeID"].GetValueOrDefault<int>().ToString();
                txtAddress.Text = dt.Rows[0]["Address"].GetValueOrDefault<string>();
                txtCity.Text = dt.Rows[0]["City"].GetValueOrDefault<string>();
                txtState.Text = dt.Rows[0]["State"].GetValueOrDefault<string>();
                txtZip.Text = dt.Rows[0]["Zip"].GetValueOrDefault<string>();
                txtOfficePhone.Text = dt.Rows[0]["OfficePhone"].GetValueOrDefault<string>();
                txtFax.Text = dt.Rows[0]["Fax"].GetValueOrDefault<string>();
                txtComments.Text = dt.Rows[0]["Comments"].GetValueOrDefault<string>();
            }
        }
Exemple #19
0
        private void PopulateCombos()
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();
            DataRow dtRow = default(DataRow);

            //Populate Client Combo
            strSQL = "SELECT ID, ClientName ";
            strSQL += "FROM tblClients";

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];
            DataView dv = dt.DefaultView;
            dv.Sort = "ClientName";

            cboClientName.DataSource = dv;
            cboClientName.DataTextField = "ClientName";
            cboClientName.DataValueField = "ID";
            cboClientName.DataBind();

            //Populate Phase Combo
            strSQL = "SELECT ID, Phase ";
            strSQL += "FROM tblPhase ";
            strSQL += "ORDER BY Sequence";

            ds = new DataSet();
            ds = General.FillDataset(strSQL);
            dt = new DataTable();
            dt = ds.Tables[0];
            dv = new DataView();
            dv = dt.DefaultView;

            cboPhase.DataSource = dv;
            cboPhase.DataTextField = "Phase";
            cboPhase.DataValueField = "ID";
            cboPhase.DataBind();

            //Populate Fee Structure Combo
            strSQL = "SELECT FeeStructureType ";
            strSQL += "FROM tblFeeStructures ";
            strSQL += "ORDER BY Sequence";

            ds = new DataSet();
            ds = General.FillDataset(strSQL);
            dt = new DataTable();
            dt = ds.Tables[0];
            dv = new DataView();
            dv = dt.DefaultView;

            cboFeeStructure.DataSource = dv;
            cboFeeStructure.DataTextField = "FeeStructureType";
            cboFeeStructure.DataValueField = "FeeStructureType";
            cboFeeStructure.DataBind();

            //Populate PIC Combo
            strSQL = "SELECT EmployeeID, EmployeeName ";
            strSQL += "FROM tblEmployees ";
            strSQL += "ORDER BY EmployeeName";

            ds = new DataSet();
            ds = General.FillDataset(strSQL);
            dt = new DataTable();
            dt = ds.Tables[0];
            dtRow = dt.NewRow();
            dtRow[0] = 0;
            dtRow[1] = "";
            dt.Rows.Add(dtRow);
            dv = new DataView();
            dv = dt.DefaultView;
            dv.Sort = "EmployeeName";

            cboPIC.DataSource = dv;
            cboPIC.DataTextField = "EmployeeName";
            cboPIC.DataValueField = "EmployeeID";
            cboPIC.DataBind();

            //Populate PM Combo
            strSQL = "SELECT EmployeeID, EmployeeName ";
            strSQL += "FROM tblEmployees ";
            strSQL += "ORDER BY EmployeeName";

            ds = new DataSet();
            ds = General.FillDataset(strSQL);
            dt = new DataTable();
            dt = ds.Tables[0];
            dtRow = dt.NewRow();
            dtRow[0] = 0;
            dtRow[1] = "";
            dt.Rows.Add(dtRow);
            dv = new DataView();
            dv = dt.DefaultView;
            dv.Sort = "EmployeeName";

            cboPM.DataSource = dv;
            cboPM.DataTextField = "EmployeeName";
            cboPM.DataValueField = "EmployeeID";
            cboPM.DataBind();

            dt.Dispose();
            dt = null;
            ds.Dispose();
            ds = null;
        }
        //
        private void PopulateForm(int intProjectID)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT tblProjects.ProjectNo, tblProjects.ProjectName ";
            strSQL += "FROM tblProjects ";
            strSQL += "WHERE (tblProjects.ID = " + intProjectID + ")";

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0) {
            this.lblProjectNo.Text = dt.Rows[0]["ProjectNo"].GetValueOrDefault<string>();
            this.lblProjectName.Text = dt.Rows[0]["ProjectName"].GetValueOrDefault<string>();
            }
        }
Exemple #21
0
        private void UpdateProject(int intProjectID)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();
            clsSchedule Schedule = new clsSchedule();
            if (intProjectID == 0)
                return;

            Project Project = new Project();

            System.Globalization.CultureInfo dateFormat = new System.Globalization.CultureInfo("en-US", true);
            DateTime estStartDate = new DateTime();
            DateTime estCompletionDate = new DateTime();
            decimal feeAmount = default(decimal);
            int pic = 0;
            string picCode = string.Empty;
            int pm = 0;
            string pmCode = string.Empty;

            if (!string.IsNullOrEmpty(txtEstStartOfConstruction.Text))
            {
                estStartDate = DateTime.Parse(txtEstStartOfConstruction.Text);
            }
            if (!string.IsNullOrEmpty(txtEstCompletionOfConstruction.Text))
            {
                estCompletionDate = DateTime.Parse(txtEstCompletionOfConstruction.Text);
            }
            if (!string.IsNullOrEmpty(txtFeeAmount.Text))
            {
                decimal.TryParse(txtFeeAmount.Text.Replace("$", "").Replace(",", ""), out feeAmount);
            }

            int.TryParse(cboPIC.SelectedValue, out pic);
            if (pic != 0)
            {
                picCode = Schedule.GetEmployeeCode(pic);
            }
            int.TryParse(cboPM.SelectedValue, out pm);
            if (pm != 0)
            {
                pmCode = Schedule.GetEmployeeCode(pm);
            }

            Project.UpdateProject(intProjectID, Convert.ToDecimal(txtProjectNo.Text), txtProjectName.Text, Convert.ToInt32(cboClientName.SelectedValue), txtProjectLocation.Text, txtConstructionType.Text, txtProjectType.Text, Convert.ToInt32(cboPhase.SelectedValue), estStartDate, estCompletionDate,
            feeAmount, cboFeeStructure.SelectedValue, txtRemarks.Text, pic, picCode, pm, pmCode, EmployeeID);
        }
        public ArrayList get_ConsultaMaterialRe(string pstrCampana, string pstrPDV, string pstrOrgVenta, string pstrCentro, string pstrPlan, ref int pintRC)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.get_ConsultaMaterialRe(pstrCampana, pstrPDV, pstrOrgVenta, pstrCentro, pstrPlan, ref pintRC));
        }
Exemple #23
0
        private void UpdateEmployee(int intEmployeeID)
        {
            clsGeneral General = new clsGeneral();
            int intActive = 0;
            int pmFiscalSummaryInt = 0;
            int picFiscalSummaryInt = 0;

            if (rbtnActiveEmployeeYes.Checked == true)
            {
                intActive = 1;
            }
            else
            {
                intActive = 0;
            }

            if (pmFiscalSummary.Checked)
            {
                pmFiscalSummaryInt = 1;
            }

            if (picFiscalSummary.Checked)
            {
                picFiscalSummaryInt = 1;
            }

            strSQL = "UPDATE tblEmployees ";
            strSQL += "SET ";
            strSQL += "EmployeeCode = '" + txtEmployeeCode.Text.GetValueOrDefault<string>() + "', ";
            strSQL += "EmployeeFirst = '" + txtFirstName.Text.GetValueOrDefault<string>() + "', ";
            strSQL += "EmployeeLast = '" + txtLastName.Text.GetValueOrDefault<string>() + "', ";
            strSQL += "EmployeeName = '" + txtLastName.Text.GetValueOrDefault<string>() + ", " + txtFirstName.Text + "', ";
            strSQL += "EmployeeTypeID = " + cboEmployeeType.SelectedValue + ", ";
            strSQL += "Address = '" + txtAddress.Text + "', ";
            strSQL += "City = '" + txtCity.Text + "', ";
            strSQL += "State = '" + txtState.Text + "', ";
            strSQL += "Zip = '" + txtZip.Text + "', ";
            strSQL += "HomePhone = '" + txtHomePhone.Text + "', ";
            strSQL += "CellPhone = '" + txtCellPhone.Text + "', ";
            strSQL += "PhoneExtension = '" + txtPhoneExtension.Text + "', ";
            strSQL += "EmailAddress = '" + txtEmail.Text + "', ";
            strSQL += "Title = '" + txtTitle.Text + "', ";
            if (string.IsNullOrEmpty(txtEmployeeStartDate.Text))
            {
                strSQL += "EmploymentStartDate = NULL, ";
            }
            else
            {
                strSQL += "EmploymentStartDate = '" + txtEmployeeStartDate.Text + "', ";
            }
            if (string.IsNullOrEmpty(txtEmployeeEndDate.Text))
            {
                strSQL += "EmploymentEndDate = NULL, ";
            }
            else
            {
                strSQL += "EmploymentEndDate = '" + txtEmployeeEndDate.Text + "', ";
            }
            strSQL += "YearsOfExperience = '" + txtYearsOfExperience.Text + "', ";
            strSQL += "Education = '" + txtEducation.Text + "', ";
            strSQL += "Licenses = '" + txtLicenses.Text + "', ";
            strSQL += "ProfessionalMemberships = '" + txtProfMemberships.Text + "', ";
            strSQL += "ProfessionalCommittees = '" + txtProfCommittees.Text + "', ";
            strSQL += "HoursPerWeek = " + txtHoursPerWeek.Text + ", ";
            strSQL += "Comments = '" + txtComments.Text + "', ";
            strSQL += "Active = " + intActive + ", ";
            strSQL += "PMFiscalSummary = " + pmFiscalSummaryInt + ", ";
            strSQL += "PICFiscalSummary = " + picFiscalSummaryInt + " ";
            strSQL += "WHERE EmployeeID = " + intEmployeeID;

            General.UpdateRecord(strSQL);
        }
        public string ConsultarIccid(string Clase_Venta, string Nro_Telefono, string Tipo_Venta)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarIccid(Clase_Venta, Nro_Telefono, Tipo_Venta));
        }
        public void setEmailController(Proyecto.Logica.Models.clsCorreo oClsCorreo)
        {
            clsGeneral oMail = new clsGeneral();

            oMail.setEmail(oClsCorreo);
        }
        public ArrayList Get_ConsultaPlanServicio(string plan, string servicio)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Get_ConsultaPlanServicio(plan, servicio));
        }
        public DataSet ConsultarAcuerdo(string p_nro_contrato, string p_nro_contrato_pcs)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarAcuerdo(p_nro_contrato, p_nro_contrato_pcs));
        }
        public ItemGenerico ConsultarPlazoAcuerdo(string p_plazo_codigo)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarPlazoAcuerdo(p_plazo_codigo));
        }
        public ItemGenerico ConsultarEstadoCivil(string p_est_civil_codigo)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarEstadoCivil(p_est_civil_codigo));
        }
        // Agregado -EMC-
        public ArrayList get_seriesxMaterial(string oficina, string material, string resultados, string telefono)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.get_seriesxMaterial(oficina, material, resultados, telefono));
        }
        public DataTable Get_CostoPromedio(string PGRUPO, string PMATNR, string PWERKS)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Get_CostoPromedio(PGRUPO, PMATNR, PWERKS));
        }
        public ArrayList Get_ConsultaCampana_X_Plan(string pstrPlan, ref int pintRC)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Get_ConsultaCampana_X_Plan(pstrPlan, ref pintRC));
        }
Exemple #33
0
        private void UpdateClient(int intClientID)
        {
            clsGeneral General = new clsGeneral();
            string strSQL = "";

            strSQL = "UPDATE tblClients ";
            strSQL += "SET ClientName = '" + txtClientName.Text + "', ";
            strSQL += "ClientTypeID = " + cboClientType.SelectedValue + ", ";
            strSQL += "Address = '" + txtAddress.Text + "', ";
            strSQL += "City = '" + txtCity.Text + "', ";
            strSQL += "State = '" + txtState.Text + "', ";
            strSQL += "Zip = '" + txtZip.Text + "', ";
            strSQL += "OfficePhone = '" + txtOfficePhone.Text + "', ";
            strSQL += "Fax = '" + txtFax.Text + "', ";
            strSQL += "Comments = '" + txtComments.Text + "' ";
            strSQL += "WHERE ID = " + intClientID;

            General.UpdateRecord(strSQL);
        }
        //Chip Repuesto Postpago


        //sans
        public string ConsultarIccid_Zs(string Clase_Venta, string Nro_Telefono, string Tipo_Venta, string Fecha_Cambio, string Material, string Material_Antig, string Serie)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarIccid_Zs(Clase_Venta, Nro_Telefono, Tipo_Venta, Fecha_Cambio, Material, Material_Antig, Serie));
        }
        public Boolean Set_ActualizaEstadoPedido(string NroPedido, string OficinaVenta, string Almacenero, string Despachador)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Set_ActualizaEstadoPedido(NroPedido, OficinaVenta, Almacenero, Despachador));
        }
Exemple #36
0
        private void UpdateProject(int intProjectID)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();
            clsSchedule Schedule = new clsSchedule();
            if (intProjectID == 0)
                return;

            strSQL = "UPDATE tblProjects ";
            strSQL += "SET ProjectName = '" + txtProjectName.Text + "', ";
            strSQL += "ProjectNo = '" + txtProjectNo.Text + "', ";
            strSQL += "ClientID = " + Convert.ToInt32(cboClientName.SelectedValue) + ", ";
            strSQL += "ProjectLocation = '" + txtProjectLocation.Text + "', ";
            strSQL += "ConstructionType = '" + txtConstructionType.Text + "', ";
            strSQL += "ProjectType = '" + txtProjectType.Text + "', ";
            strSQL += "PhaseID = " + Convert.ToInt32(cboPhase.SelectedValue) + ", ";
            if (!string.IsNullOrEmpty(txtEstStartOfConstruction.Text))
            {
                strSQL += "EstimatedStartDate = '" + txtEstStartOfConstruction.Text + "', ";
            }
            else
            {
                strSQL += "EstimatedStartDate = NULL, ";
            }
            if (!string.IsNullOrEmpty(txtEstCompletionOfConstruction.Text))
            {
                strSQL += "EstimatedCompletionDate = '" + txtEstCompletionOfConstruction.Text + "', ";
            }
            else
            {
                strSQL += "EstimatedCompletionDate = NULL, ";
            }
            if (!string.IsNullOrEmpty(txtFeeAmount.Text))
            {
                decimal feeAmount = 0;
                decimal.TryParse(txtFeeAmount.Text.Replace("$", "").Replace(",", ""), out feeAmount);
                strSQL += "FeeAmount = " + feeAmount.ToString() + ", ";
            }
            else
            {
                strSQL += "FeeAmount = NULL, ";
            }
            strSQL += "FeeStructure = '" + cboFeeStructure.SelectedValue + "', ";

            if (Convert.ToInt32(cboPIC.SelectedValue) != 0)
            {
                strSQL += "PIC = " + cboPIC.SelectedValue + ", ";
                strSQL += "PICCode = '" + Schedule.GetEmployeeCode(Convert.ToInt32(cboPIC.SelectedValue)) + "', ";
            }
            else
            {
                strSQL += "PIC = NULL, ";
                strSQL += "PICCode = NULL, ";
            }

            if (Convert.ToInt32(cboPM.SelectedValue) != 0)
            {
                strSQL += "PM1 = " + cboPM.SelectedValue + ", ";
                strSQL += "PM1Code = '" + Schedule.GetEmployeeCode(Convert.ToInt32(cboPM.SelectedValue)) + "', ";
            }
            else
            {
                strSQL += "PM1 = NULL, ";
                strSQL += "PM1Code = NULL, ";
            }

            strSQL += "Comments = '" + txtRemarks.Text + "' ";
            strSQL += "WHERE ID = " + intProjectID;

            General.FillDataset(strSQL);
        }
Exemple #37
0
        private void PopulateForm()
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT tblProjects.*, tblPhase.Phase, tblClients.ClientName, ";
            strSQL += "(select MAX(LastModifiedDate) from tblSchedule s where s.ProjectID = tblProjects.ID) as LastModified,";
            strSQL += "(select distinct EmployeeName from tblEmployees e inner join tblSchedule s on s.LastModifiedByUserID = e.EmployeeID where s.ProjectID = tblProjects.ID and s.LastModifiedDate = (select MAX(LastModifiedDate) from tblSchedule ss where ss.ProjectID = tblProjects.ID)) as LastModifiedBy ";
            strSQL += "FROM tblPhase RIGHT OUTER JOIN ";
            strSQL += "tblProjects ON tblPhase.ID = tblProjects.PhaseID LEFT OUTER JOIN ";
            strSQL += "tblClients ON tblProjects.ClientID = tblClients.ID ";
            strSQL += "WHERE (tblProjects.ID = " + SelectedProjectID + ")";

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0)
            {
                lblProjectName.Text = dt.Rows[0]["ProjectName"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ProjectName"], "");
                lblProjectNo.Text = dt.Rows[0]["ProjectNo"].GetValueOrDefault<string>(); //basToolbox.Nz(dt.Rows[0]["ProjectNo"], "");
                lblPIC.Text = dt.Rows[0]["PICCode"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["PICCode"], "");
                lblPM.Text = dt.Rows[0]["PM1Code"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["PM1Code"], "");
                lblClientName.Text = dt.Rows[0]["ClientName"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ClientName"], "");
                lblProjectLocation.Text = dt.Rows[0]["ProjectLocation"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ProjectLocation"], "");
                lblConstructionType.Text = dt.Rows[0]["ConstructionType"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ConstructionType"], "");
                lblProjectType.Text = dt.Rows[0]["ProjectType"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ProjectType"], "");
                lblPhase.Text = dt.Rows[0]["Phase"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["Phase"], "");

                var estStartOfConstruction = dt.Rows[0]["EstimatedStartDate"].GetValueOrDefault<DateTime>();
                if (estStartOfConstruction != null && estStartOfConstruction != DateTime.MinValue)
                {
                    lblEstStartOfConstruction.Text = estStartOfConstruction.ToShortDateString(); // basToolbox.Nz(dt.Rows[0]["EstimatedStartDate"], "");
                }

                var estCompletionOfConstruction = dt.Rows[0]["EstimatedCompletionDate"].GetValueOrDefault<DateTime>();
                if (estCompletionOfConstruction != null && estCompletionOfConstruction != DateTime.MinValue)
                {
                    lblEstCompletionOfConstruction.Text = estCompletionOfConstruction.ToShortDateString(); // basToolbox.Nz(dt.Rows[0]["EstimatedCompletionDate"], "");
                }

                lblFeeAmount.Text = dt.Rows[0]["FeeAmount"].GetValueOrDefault<decimal>().ToString("C"); // Strings.FormatNumber(basToolbox.Nz(dt.Rows[0]["FeeAmount"], 0), 2);
                lblFeeStructure.Text = dt.Rows[0]["FeeStructure"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["FeeStructure"], "");
                lblRemarks.Text = dt.Rows[0]["Comments"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["Comments"], "");

                var lastModifiedDate = dt.Rows[0]["LastModified"].GetValueOrDefault<DateTime>();
                if (lastModifiedDate != null && lastModifiedDate != DateTime.MinValue)
                {
                    lblLastUpdated.Text = string.Format("{0} by {1}", lastModifiedDate.ToShortDateString(), dt.Rows[0]["LastModifiedBy"].GetValueOrDefault<string>()); //  basToolbox.Nz(dt.Rows[0]["LastModified"], ""), basToolbox.Nz(dt.Rows[0]["LastModifiedBy"], ""));
                }
            }
        }
Exemple #38
0
        private void PopulateEmployee(System.Object intEmployeeID)
        {
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT * FROM tblEmployees ";
            strSQL += "WHERE EmployeeID = " + intEmployeeID;

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0) {
            txtEmployeeCode.Text = dt.Rows[0]["EmployeeCode"].GetValueOrDefault<string>();
            txtFirstName.Text = dt.Rows[0]["EmployeeFirst"].GetValueOrDefault<string>();
            txtLastName.Text = dt.Rows[0]["EmployeeLast"].GetValueOrDefault<string>();
            cboEmployeeType.SelectedValue = dt.Rows[0]["EmployeeTypeID"].GetValueOrDefault<int>().ToString();
            txtAddress.Text = dt.Rows[0]["Address"].GetValueOrDefault<string>();
            txtCity.Text = dt.Rows[0]["City"].GetValueOrDefault<string>();
            txtState.Text = dt.Rows[0]["State"].GetValueOrDefault<string>();
            txtZip.Text = dt.Rows[0]["Zip"].GetValueOrDefault<string>();
            txtHomePhone.Text = dt.Rows[0]["HomePhone"].GetValueOrDefault<string>();
            txtCellPhone.Text = dt.Rows[0]["CellPhone"].GetValueOrDefault<string>();
            txtPhoneExtension.Text = dt.Rows[0]["PhoneExtension"].GetValueOrDefault<string>();
            txtEmail.Text = dt.Rows[0]["EmailAddress"].GetValueOrDefault<string>();
            txtTitle.Text = dt.Rows[0]["Title"].GetValueOrDefault<string>();
            txtEmployeeStartDate.Text = dt.Rows[0]["EmploymentStartDate"].GetValueOrDefault<string>();
            txtEmployeeEndDate.Text = dt.Rows[0]["EmploymentEndDate"].GetValueOrDefault<string>();
            txtYearsOfExperience.Text = dt.Rows[0]["YearsOfExperience"].GetValueOrDefault<string>();
            txtEducation.Text = dt.Rows[0]["Education"].GetValueOrDefault<string>();
            txtLicenses.Text = dt.Rows[0]["Licenses"].GetValueOrDefault<string>();
            txtProfMemberships.Text = dt.Rows[0]["ProfessionalMemberships"].GetValueOrDefault<string>();
            txtProfCommittees.Text = dt.Rows[0]["ProfessionalCommittees"].GetValueOrDefault<string>();
            txtHoursPerWeek.Text = dt.Rows[0]["HoursPerWeek"].GetValueOrDefault<decimal>().ToString();
            txtComments.Text = dt.Rows[0]["Comments"].GetValueOrDefault<string>();
            if (dt.Rows[0]["Active"].GetValueOrDefault<int>() == 0) {
                rbtnActiveEmployeeNo.Checked = true;
                rbtnActiveEmployeeYes.Checked = false;
            } else {
                rbtnActiveEmployeeYes.Checked = true;
                rbtnActiveEmployeeNo.Checked = false;
            }
            if (dt.Rows[0]["PMFiscalSummary"].GetValueOrDefault<bool>() == true) {
                pmFiscalSummary.Checked = true;
            }
            if (dt.Rows[0]["PICFiscalSummary"].GetValueOrDefault<bool>() == true)
            {
                picFiscalSummary.Checked = true;
            }
            }

            dt.Dispose();
            dt = null;
            ds.Dispose();
            ds = null;
        }
        public string ConsultarPrefijo(string p_fecha_documento, string p_oficina_venta, string p_tipo_documento)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarPrefijo(p_fecha_documento, p_oficina_venta, p_tipo_documento));
        }
        public DataSet Get_ConsultaCierreCaja(string p_oficinaVenta, string p_fecha, out string v_cierre_realizado)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Get_ConsultaCierreCaja(p_oficinaVenta, p_fecha, out v_cierre_realizado));
        }
Exemple #41
0
        private void DeleteUser(int intEmployeeID)
        {
            clsGeneral General = new clsGeneral();

            strSQL = "DELETE FROM tblUsers ";
            strSQL += "WHERE EmployeeID = " + intEmployeeID;

            General.DeleteRecord(strSQL);
        }
        public DataSet ConsultarTipoDocumentoOfVenta(string p_oficina_venta)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarTipoDocumentoOfVenta(p_oficina_venta));
        }
Exemple #43
0
        private void PopulateUser(int intEmployeeID)
        {
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT UserName, Password ";
            strSQL += "FROM tblUsers ";
            strSQL += "WHERE EmployeeID = " + intEmployeeID;

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0)
            {
                rbtnUserNo.Checked = false;
                rbtnUserYes.Checked = true;
                pnlUserAccount.Visible = true;
                txtUserName.Text = dt.Rows[0]["Username"].GetValueOrDefault<string>();
                txtPassword.Text = dt.Rows[0]["Password"].GetValueOrDefault<string>();
            }
            else
            {
                rbtnUserNo.Checked = true;
                rbtnUserYes.Checked = false;
                pnlUserAccount.Visible = false;
            }
        }
        public ArrayList Get_ConsultaPlanTarifario(string tipoClienteAct, string Utilizacion, string TipoVenta, string CodPlan)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Get_ConsultaPlanTarifario(tipoClienteAct, Utilizacion, TipoVenta, CodPlan));
        }
Exemple #45
0
        private void PopulateForm(int intProjectID)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT tblProjects.*, tblPhase.Phase, tblClients.ClientName ";
            strSQL += "FROM tblPhase RIGHT OUTER JOIN ";
            strSQL += "tblProjects ON tblPhase.ID = tblProjects.PhaseID LEFT OUTER JOIN ";
            strSQL += "tblClients ON tblProjects.ClientID = tblClients.ID ";
            strSQL += "WHERE (tblProjects.ID = " + intProjectID + ")";

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0)
            {
                txtProjectName.Text = dt.Rows[0]["ProjectName"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ProjectName"], "");
                txtProjectNo.Text = dt.Rows[0]["ProjectNo"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ProjectNo"], "");
                lblProjectNo.Text = dt.Rows[0]["ProjectNo"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ProjectNo"], "");
                if (dt.Rows[0]["PM1"] != DBNull.Value) //object.ReferenceEquals(dt.Rows[0]["PM1"], DBNull.Value)))
                {
                    cboPM.SelectedValue = dt.Rows[0]["PM1"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["PM1"], 0);
                }
                if (dt.Rows[0]["PIC"] != DBNull.Value) //(!object.ReferenceEquals(dt.Rows[0]["PIC"], DBNull.Value)))
                {
                    cboPIC.SelectedValue = dt.Rows[0]["PIC"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["PIC"], 0);
                }
                cboClientName.SelectedValue = dt.Rows[0]["ClientID"].GetValueOrDefault<int>().ToString(); // basToolbox.Nz(dt.Rows[0]["ClientID"], 1);
                txtProjectLocation.Text = dt.Rows[0]["ProjectLocation"].GetValueOrDefault<string>();// basToolbox.Nz(dt.Rows[0]["ProjectLocation"], "");
                txtConstructionType.Text = dt.Rows[0]["ConstructionType"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ConstructionType"], "");
                txtProjectType.Text = dt.Rows[0]["ProjectType"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["ProjectType"], "");
                cboPhase.SelectedValue = dt.Rows[0]["PhaseID"].GetValueOrDefault<int>().ToString(); // basToolbox.Nz(dt.Rows[0]["PhaseID"], 1);

                var estStartOfConstruction = dt.Rows[0]["EstimatedStartDate"].GetValueOrDefault<DateTime>();
                var estCompletionOfConstruction = dt.Rows[0]["EstimatedCompletionDate"].GetValueOrDefault<DateTime>();

                if (estStartOfConstruction != null && estStartOfConstruction != DateTime.MinValue)
                {
                    txtEstStartOfConstruction.Text = estStartOfConstruction.ToShortDateString(); // basToolbox.Nz(dt.Rows[0]["EstimatedStartDate"], "");
                }

                if (estCompletionOfConstruction != null && estCompletionOfConstruction != DateTime.MinValue)
                {
                    txtEstCompletionOfConstruction.Text = estCompletionOfConstruction.ToShortDateString(); // basToolbox.Nz(dt.Rows[0]["EstimatedCompletionDate"], "");
                }

                txtFeeAmount.Text = dt.Rows[0]["FeeAmount"].GetValueOrDefault<decimal>().ToString("C"); // Strings.FormatNumber(basToolbox.Nz(dt.Rows[0]["FeeAmount"], 0), 2);
                if (dt.Rows[0]["FeeStructure"] != DBNull.Value) //  object.ReferenceEquals(dt.Rows[0]["FeeStructure"], DBNull.Value))
                {
                    cboFeeStructure.SelectedValue = dt.Rows[0]["FeeStructure"].GetValueOrDefault<int>().ToString(); // basToolbox.Nz(dt.Rows[0]["FeeStructure"], 1);
                }
                txtRemarks.Text = dt.Rows[0]["Comments"].GetValueOrDefault<string>(); // basToolbox.Nz(dt.Rows[0]["Comments"], "");
            }
        }
        public DataSet Set_ActualizaCreaCliente(string OficinaVta, string[] arrCliente)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Set_ActualizaCreaCliente(OficinaVta, arrCliente));
        }
Exemple #47
0
        private void PopulateForm(int intProjectID)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT tblProjects.*, tblPhase.Phase, tblClients.ClientName ";
            strSQL += "FROM tblPhase RIGHT OUTER JOIN ";
            strSQL += "tblProjects ON tblPhase.ID = tblProjects.PhaseID LEFT OUTER JOIN ";
            strSQL += "tblClients ON tblProjects.ClientID = tblClients.ID ";
            strSQL += "WHERE (tblProjects.ID = " + intProjectID + ")";

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0) {
            txtProjectName.Text = dt.Rows[0]["ProjectName"].GetValueOrDefault<string>();
            txtProjectNo.Text = dt.Rows[0]["ProjectNo"].GetValueOrDefault<string>();
            lblProjectNo.Text = dt.Rows[0]["ProjectNo"].GetValueOrDefault<string>();

            if (!string.IsNullOrEmpty(dt.Rows[0]["PM1"].GetValueOrDefault<string>()))
            {
                cboPM.SelectedValue = dt.Rows[0]["PM1"].GetValueOrDefault<string>();
            }

            if (!string.IsNullOrEmpty(dt.Rows[0]["PIC"].GetValueOrDefault<string>()))
            {
                cboPIC.SelectedValue = dt.Rows[0]["PIC"].GetValueOrDefault<string>();
            }

            cboClientName.SelectedValue = dt.Rows[0]["ClientID"].GetValueOrDefault<string>();
            txtProjectLocation.Text = dt.Rows[0]["ProjectLocation"].GetValueOrDefault<string>();
            txtConstructionType.Text = dt.Rows[0]["ConstructionType"].GetValueOrDefault<string>();
            txtProjectType.Text = dt.Rows[0]["ProjectType"].GetValueOrDefault<string>();
            cboPhase.SelectedValue = dt.Rows[0]["PhaseID"].GetValueOrDefault<string>();
            txtEstStartOfConstruction.Text = dt.Rows[0]["EstimatedStartDate"].GetValueOrDefault<string>();
            txtEstCompletionOfConstruction.Text = dt.Rows[0]["EstimatedCompletionDate"].GetValueOrDefault<string>();
            txtFeeAmount.Text = dt.Rows[0]["FeeAmount"].GetValueOrDefault<decimal>().ToString("c");
            if (string.IsNullOrEmpty(dt.Rows[0]["FeeStructure"].GetValueOrDefault<string>()))
            {
            } else {
                cboFeeStructure.SelectedValue = dt.Rows[0]["FeeStructure"].GetValueOrDefault<string>();
            }
            txtRemarks.Text = dt.Rows[0]["Comments"].GetValueOrDefault<string>();
            }
        }
        public DataSet Get_ConsultaCliente(string Oficina, string TipDocCliente, string Cliente)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Get_ConsultaCliente(Oficina, TipDocCliente, Cliente));
        }
Exemple #49
0
        private bool ValidateForm()
        {
            System.DateTime dtmDateTimeUS = default(System.DateTime);
            System.Globalization.CultureInfo format = new System.Globalization.CultureInfo("en-US", true);

            if (string.IsNullOrEmpty(txtProjectName.Text))
            {
                lblError.Text = "Please enter project name.";
                lblError.Visible = true;
                return false;
            }

            if (string.IsNullOrEmpty(txtProjectNo.Text))
            {
                lblError.Text = "Please enter project number.";
                lblError.Visible = true;
                return false;
            }

            if (txtProjectNo.Text != lblProjectNo.Text)
            {
                //Check Dupe Job #
                string strSQL = "";
                clsGeneral General = new clsGeneral();
                strSQL = "SELECT ID FROM tblProjects ";
                strSQL += "WHERE ProjectNo = '" + txtProjectNo.Text + "'";
                DataSet ds = General.FillDataset(strSQL);
                DataTable dt = ds.Tables[0];

                if (dt.Rows.Count > 0)
                {
                    lblError.Text = "Project number already exists.";
                    lblError.Visible = true;
                    return false;
                }
            }

            if (string.IsNullOrEmpty(cboClientName.SelectedItem.Text))
            {
                lblError.Text = "Please select a client.";
                lblError.Visible = true;
                return false;
            }

            if (!string.IsNullOrEmpty(txtEstStartOfConstruction.Text))
            {
                try
                {
                    dtmDateTimeUS = System.DateTime.Parse(txtEstStartOfConstruction.Text, format);
                }
                catch (Exception ex)
                {
                    lblError.Text = "Please enter a valid start of construction date - ex: mm/dd/yyyy.";
                    lblError.Visible = true;
                    return false;
                }
            }

            if (!string.IsNullOrEmpty(txtEstCompletionOfConstruction.Text))
            {
                try
                {
                    dtmDateTimeUS = System.DateTime.Parse(txtEstCompletionOfConstruction.Text, format);
                }
                catch (Exception ex)
                {
                    lblError.Text = "Please enter a valid completion of construction date - ex: mm/dd/yyyy.";
                    lblError.Visible = true;
                    return false;
                }
            }

            lblError.Text = "";
            lblError.Visible = false;
            return true;
        }
        public DataSet SetGetLogActivacionChip(string nroDocumento, string puntoVenta, string strLog, ref string nroSolicitud)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.SetGetLogActivacionChip(nroDocumento, puntoVenta, strLog, ref nroSolicitud));
        }
        //
        private void PopulateForm(int intEmployeeID)
        {
            string strSQL = "";
            clsGeneral General = new clsGeneral();

            strSQL = "SELECT * ";
            strSQL += "FROM tblEmployees ";
            strSQL += "WHERE EmployeeID = " + intEmployeeID;

            DataSet ds = General.FillDataset(strSQL);
            DataTable dt = ds.Tables[0];

            if (dt.Rows.Count > 0)
            {
                lblName.Text = dt.Rows[0]["EmployeeFirst"].GetValueOrDefault<string>() + " " + dt.Rows[0]["EmployeeLast"].GetValueOrDefault<string>();
            }

            ds.Dispose();
            ds = null;
            dt.Dispose();
            dt = null;
        }
        public DataSet Get_ConsultaPedido(string Referencia, string Oficina, string Nro_Sap, string Tipo_Documento)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Get_ConsultaPedido(Referencia, Oficina, Nro_Sap, Tipo_Documento));
        }
Exemple #53
0
 private void AddEmployee()
 {
     clsGeneral General = new clsGeneral();
     SqlConnection conn = default(SqlConnection);
     SqlCommand cmd = default(SqlCommand);
     string strConn = General.strConn;
     int intEmployeeID = 0;
     string strFirst = this.txtFirstName.Text;
     string strLast = this.txtLastName.Text;
     string strName = null;
     int intActive = 0;
     if (this.rbtnActiveEmployeeYes.Checked)
     {
         intActive = 1;
     }
     strName = strLast + ", " + strFirst;
     //
     strSQL = "INSERT INTO tblEmployees ";
     strSQL += "(EmployeeCode, EmployeeFirst, EmployeeLast, EmployeeName, ";
     strSQL += "EmployeeTypeID, Address, City, State, Zip, ";
     strSQL += "HomePhone, CellPhone, Title, EmploymentStartDate, EmploymentEndDate, YearsOfExperience, ";
     strSQL += "Education, Licenses, ProfessionalMemberships, ProfessionalCommittees, HoursPerWeek, ";
     strSQL += "Comments, Active) ";
     strSQL += "VALUES (";
     strSQL += "'" + this.txtEmployeeCode.Text + "', ";
     strSQL += "'" + strFirst + "', ";
     strSQL += "'" + strLast + "', ";
     strSQL += "'" + strName + "', ";
     strSQL += this.cboEmployeeType.SelectedValue + ", ";
     strSQL += "'" + this.txtAddress.Text + "', ";
     strSQL += "'" + this.txtCity.Text + "', ";
     strSQL += "'" + this.txtState.Text + "', ";
     strSQL += "'" + this.txtZip.Text + "', ";
     strSQL += "'" + this.txtHomePhone.Text + "', ";
     strSQL += "'" + this.txtCellPhone.Text + "', ";
     strSQL += "'" + this.txtTitle.Text + "', ";
     //
     if (string.IsNullOrEmpty(this.txtEmployeeStartDate.Text))
     {
         strSQL += "NULL, ";
     }
     else
     {
         strSQL += "'" + this.txtEmployeeStartDate.Text + "', ";
     }
     if (string.IsNullOrEmpty(this.txtEmployeeEndDate.Text))
     {
         strSQL += "NULL, ";
     }
     else
     {
         strSQL += "'" + this.txtEmployeeEndDate.Text + "', ";
     }
     //
     strSQL += "'" + this.txtYearsOfExperience.Text + "', ";
     strSQL += "'" + this.txtEducation.Text + "', ";
     strSQL += "'" + this.txtLicenses.Text + "', ";
     strSQL += "'" + this.txtProfMemberships.Text + "', ";
     strSQL += "'" + this.txtProfCommittees.Text + "', ";
     strSQL += this.txtHoursPerWeek.Text + ", ";
     strSQL += "'" + this.txtComments.Text + "', ";
     strSQL += intActive + ") ";
     strSQL += "SELECT @EmployeeID = @@identity";
     conn = new SqlConnection(strConn);
     cmd = new SqlCommand(strSQL, conn);
     SqlParameter prmEmpID = new SqlParameter("@EmployeeID", SqlDbType.Int);
     prmEmpID.Direction = ParameterDirection.Output;
     cmd.Parameters.Add(prmEmpID);
     //
     conn.Open();
     cmd.ExecuteNonQuery();
     //
     intEmployeeID = prmEmpID.Value.GetValueOrDefault<int>();
     //
     conn.Close();
     conn = null;
     cmd = null;
     //
     if (this.rbtnUserYes.Checked == true)
     {
         // Add User
         strSQL = "INSERT INTO tblUsers ";
         strSQL += "(UserName, Password, UserLevel, EmployeeID) ";
         strSQL += "VALUES (";
         strSQL += "'" + this.txtUserName.Text + "', ";
         strSQL += "'" + this.txtPassword.Text + "', ";
         strSQL += "'User', ";
         strSQL += intEmployeeID + ")";
         General.AddRecord(strSQL);
     }
     //
 }
        public DataSet Set_AnularDocumentoJob(string CadenaDocumento, string Usuario)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.Set_AnularDocumentoJob(CadenaDocumento, Usuario));
        }
        //fin sans

        //consolidado 21012015

        public bool CrearDepositoGarantia(string CadenaDeposito, out string NroDeposito)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.CrearDepositoGarantia(CadenaDeposito, out NroDeposito));
        }
        public DataSet ConsultarParametrosOfVenta(string p_oficina_venta)
        {
            clsGeneral obj = new clsGeneral();

            return(obj.ConsultarParametrosOfVenta(p_oficina_venta));
        }