Beispiel #1
0
        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            try
            {
                GridDataItem item = (GridDataItem)e.Item;
                ViewState["sIDAlumno"] = item.GetDataKeyValue("psIDAlumno").ToString();
                ViewState["sIDPago"]   = item.GetDataKeyValue("psIDPago").ToString();

                if (e.CommandName == "RegistraPago")
                {
                    if (item.GetDataKeyValue("psEstado").ToString() == "PAGADO")
                    {
                        RadWindowManager2.RadAlert("El Grupo ya existe, verifique !!", 270, 150, "Mensaje", "refreshGrid", "../IMAGES/warning.png");
                    }
                    else
                    {
                        // RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(@"openWin('RegistraPago.aspx','" + CreaTokenPost() + "','RadWindow1');");
                        RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(@"openWin('RegistraPago.aspx','" + CreaTokenPost() + "','RadWindow1');");
                    }
                    //   Response.Redirect("RegistraPago.aspx?Token=" + CreaTokenPost());
                }
                if (e.CommandName == "VerFicha")
                {
                    //  RadAjaxManager1.ResponseScripts.Add(@"openWin('../REPORTES/CotizacionRpt.aspx','" + CreaTokenPost() + "','IMPRIME COTIZACION','RadWindow1');");

                    // RadAjaxManager1.ResponseScripts.Add(@"openWin('../Reportes/AlumnoRpt.aspx','" + CreaTokenPost() + "','IMPRIME FICHA ALUMNO','RadWindow1');");
                    //  RadAjaxManager1.ResponseScripts.Add(@"openPrint('../Reportes/AlumnoRpt.aspx','" + CreaTokenPost() + "','IMPRIME FICHA ALUMNO','RadWindow1');");
                }
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int code_ostad = Convert.ToInt32(Session[sessionNames.userID_StudentOstad]);
                if (ProfReqBuss.HasPendingRequest(code_ostad, (int)RequestTypeId.EditHokm))
                {
                    ShowView = false;
                    string msg = "شما به دلیل وجود درخواست تایید نشده از این نوع درخواست نمی توانید درخواست جدید ثبت کنید.";
                    RadWindowManager2.RadAlert(msg, 500, 100, "پیام سیستم", "RedirectToMain");
                    return;
                }
                LoadInfoToForm();
            }
            if (flpHokm.UploadedFiles.Count > 0)
            {
                UploadedFile obj = flpHokm.UploadedFiles[0];
                string       ScanMadarekURL;
                if (!Directory.Exists(Server.MapPath("~/University/CooperationRequest/Teachers/ScanMadarek/")))
                {
                    Directory.CreateDirectory(Server.MapPath("~/University/CooperationRequest/Teachers/ScanMadarek/"));
                }
                string subPath = Server.MapPath("~/University/CooperationRequest/Teachers/ScanMadarek/") + Session[sessionNames.userID_StudentOstad].ToString() + "\\";

                bool exists = System.IO.Directory.Exists(subPath);

                if (!exists)
                {
                    System.IO.Directory.CreateDirectory(subPath);
                }
                try
                {
                    ScanMadarekURL = subPath + "Hokm" + DateTime.Now.ToPeString("yyyy-MM-dd_HH-mm-ss") + obj.GetName();
                    obj.SaveAs(ScanMadarekURL.improveFileName(), true);
                }
                catch (Exception)
                {
                    throw;
                }
                Session.Add("ScanMadarekURL", ScanMadarekURL);
            }
        }
    private void UpdateBasePartAttributes(string basePart, string releaseId, string salesperson, DateTime?dateOfAward, string typeOfAward, string family, string customer, string parentCustomer, string productLine,
                                          string empireMarketSegment, string empireMarketSubsegment, string empireApplication, DateTime?sop, DateTime?midModelYear, DateTime?eop, string note, bool includeInForecast)
    {
        //RadWindowManager2.RadAlert(basePart + ", " + releaseId + ", " + salesperson + ", " + dateOfAward.ToString() + ", " + typeOfAward + ", " + family + ", " + customer + ", " +
        //parentCustomer + ", " + productLine + ", " + empireMarketSegment + ", " + empireMarketSubsegment + ", " + empireApplication + ", " + sop.ToString() + ", " +
        //midModelYear.ToString() + ", " + eop.ToString() + ", " + note + ", " + includeInForecast.ToString()  , 330, 180, "Message", "");

        try
        {
            using (SqlConnection connection = new SqlConnection("Server=eeisql1;Database=MONITOR;User Id=Andre;"))
            {
                SqlCommand command = new SqlCommand("eeiuser.acctg_csm_sp_update_base_part_attributes", connection);
                command.CommandTimeout = 180;
                command.CommandType    = System.Data.CommandType.StoredProcedure;
                command.Parameters.Add("@base_part", SqlDbType.VarChar).Value                = basePart;
                command.Parameters.Add("@release_id", SqlDbType.VarChar).Value               = releaseId;
                command.Parameters.Add("@salesperson", SqlDbType.VarChar).Value              = salesperson;
                command.Parameters.Add("@date_of_award", SqlDbType.Date).Value               = dateOfAward;
                command.Parameters.Add("@type_of_award", SqlDbType.VarChar).Value            = typeOfAward;
                command.Parameters.Add("@family", SqlDbType.VarChar).Value                   = family;
                command.Parameters.Add("@customer", SqlDbType.VarChar).Value                 = customer;
                command.Parameters.Add("@parent_customer", SqlDbType.VarChar).Value          = parentCustomer;
                command.Parameters.Add("@product_line", SqlDbType.VarChar).Value             = productLine;
                command.Parameters.Add("@empire_market_segment", SqlDbType.VarChar).Value    = empireMarketSegment;
                command.Parameters.Add("@empire_market_subsegment", SqlDbType.VarChar).Value = empireMarketSubsegment;
                command.Parameters.Add("@empire_application", SqlDbType.VarChar).Value       = empireApplication;
                command.Parameters.Add("@empire_sop", SqlDbType.SmallDateTime).Value         = sop;
                command.Parameters.Add("@mid_model_year", SqlDbType.DateTime).Value          = midModelYear;
                command.Parameters.Add("@empire_eop", SqlDbType.SmallDateTime).Value         = eop;
                command.Parameters.Add("@empire_eop_note", SqlDbType.VarChar).Value          = note;
                command.Parameters.Add("@include_in_forecast", SqlDbType.Bit).Value          = includeInForecast;

                connection.Open();
                command.ExecuteNonQuery();
                connection.Close();
            }
        }
        catch (Exception ex)
        {
            RadWindowManager2.RadAlert(ex.Message, 330, 180, "Error at UpdateBasePartAttributes()", "");
        }
    }
Beispiel #4
0
        protected void rbConfirm_OK_Click(object sender, EventArgs e)
        {
            DataTable      dtMessage = new DataTable();
            CommonBusiness cmnb      = new CommonBusiness();

            foreach (GridDataItem item in grd_ListAfterCreateEmail.MasterTableView.Items)
            {
                CheckBox CheckBox1 = item.FindControl("CheckBox1") as CheckBox;
                if (CheckBox1 != null && CheckBox1.Checked)
                {
                    Email_Class             emDTO    = new Email_Class();
                    List <Email_ConnectDTO> emConDTO = new List <Email_ConnectDTO>();

                    string RequestID = item.GetDataKeyValue("Id").ToString();

                    emDTO = emB.Email_Reg_Byid(int.Parse(RequestID));
                    string stcode   = emDTO.Stcode;
                    string MailText = "<html><div dir='rtl'>" + cmnb.GetAppIDMessage(1, 2, 1, 4).Rows[0]["Text"].ToString() + "</br>" + "نام کاربری:" + emDTO.Email_Address + "</br>" + "معاونت فنی دانشگاه آزاد اسلامی واحدالکترونیکی" + "</div></html>";

                    //ramezaninan-940409-start
                    DataTable dtMssage = cmnb.GetAppIDMessage(0, 2, 1, 4);
                    int       id_msg   = int.Parse(dtMssage.Rows[0]["ID"].ToString());
                    string    smsText  = dtMssage.Rows[0]["Text"].ToString() + "\r\n" + "نام کاربری:" + emDTO.Email_Address + "\r\n" + "معاونت فنی دانشگاه آزاد اسلامی واحدالکترونیکی";
                    //ramezaninan-940409-end



                    // add Reset pass
                    //if (emB.ChangePassEmail_AfterCreateEmail(stcode))
                    if (emB.ChangePassEmail_AfterCreateEmail(stcode, RequestID))
                    //==========================
                    {
                        emB.Update_Request(RequestID, "-", 4);
                        cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_Karbar].ToString()), 9, stcode, int.Parse(RequestID));

                        if (emDTO.UpdateEmail)
                        {
                            emB.UpdateSecondEmail_fsf2(stcode, emDTO.Email_Address.ToString() + "@iauec.ac.ir");
                        }
                        if (emDTO.ConnectType == 0)
                        {
                            //Send EMail

                            //  cmnb.SendEmail(emDTO.CEMAIL, "سامانه ایجاد پست الکترونیکی دانشگاه آزاد اسلامی واحد الکترونیکی", MailText);

                            cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_Karbar].ToString()), 27, stcode + "-status4", int.Parse(RequestID));
                        }
                        else if (emDTO.ConnectType == 1)
                        {
                            //send sms
                            // از طریق وب سرویس آسانک
                            //ramezaninan-940409-start
                            //lbl_Resault.Text = cmnb.SendSMSByMobile(emDTO.Mobile, smsText, username, pass, source, uri);
                            bool   sentSMS;
                            string smsStatusText;


                            lbl_Resault.Text = cmnb.sendSMS(emDTO.Mobile, smsText, out sentSMS, out smsStatusText);
                            Lbl_Status.Text  = EmailCommonBusiness.getAsanakStatusID(lbl_Resault.Text).ToString();

                            EmailCommonBusiness.LogStatusMessage(stcode, lbl_Resault.Text, emDTO.Mobile, Convert.ToInt32(Lbl_Status.Text), smsStatusText, id_msg);



                            cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_Karbar].ToString()), 28, stcode + "-status4", int.Parse(RequestID));
                        }
                        else if (emDTO.ConnectType == 2)
                        {
                            bool sentSMS; string smsStatusText;
                            //send sms
                            //ازطریق وب سرویس آسانک
                            //ramezaninan-940409-start
                            //lbl_Resault.Text = cmnb.SendSMSByMobile(emDTO.Mobile, smsText, username, pass, source, uri);
                            lbl_Resault.Text = cmnb.sendSMS(emDTO.Mobile, smsText, out sentSMS, out smsStatusText);
                            Lbl_Status.Text  = EmailCommonBusiness.getAsanakStatusID(lbl_Resault.Text).ToString();

                            EmailCommonBusiness.LogStatusMessage(stcode, lbl_Resault.Text, emDTO.Mobile, Convert.ToInt32(Lbl_Status.Text), smsStatusText, id_msg);



                            //Send EMail

                            //  cmnb.SendEmail(emDTO.CEMAIL, "سامانه ایجاد پست الکترونیکی دانشگاه آزاد اسلامی واحد الکترونیکی", MailText);

                            cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_Karbar].ToString()), 29, stcode + "-status4", int.Parse(RequestID));
                        }

                        Response.Redirect("List_AfterCreateEmail.aspx?id=" + generaterandomstr(11) + "@A" + Session[sessionNames.menuID].ToString() + "-" + generaterandomstr(2), false);
                    }
                    else
                    {
                        RadWindowManager2.RadAlert("خطا در بروز رسانی صورت گرفت", 300, 200, "پیام", "");
                    }
                }
                //catch (Exception)
                //{
                //    RadWindowManager1.RadAlert("خطا در بروز رسانی", 300, 200, "پیام", "CallBackConfirm");
                //    //Response.Redirect("List_AfterCreateEmail.aspx");
                //}
            }
        }
    protected void BasePartAttributesRadGrid_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        try
        {
            string basePart  = BasePartComboBox.SelectedValue;
            string releaseId = ReleaseIDComboBox.SelectedValue;

            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem editableItem = e.Item as GridEditableItem;

                TextBox tbxSalesPerson = editableItem["Salesperson"].Controls[0] as TextBox;
                string  salesperson    = tbxSalesPerson.Text;

                DateTime?dtDateOfAward  = null;
                TextBox  tbxDateOfAward = editableItem["DateOfAward"].Controls[0] as TextBox;
                string   dateOfAward    = tbxDateOfAward.Text.Trim();
                if (dateOfAward != "")
                {
                    dtDateOfAward = Convert.ToDateTime(dateOfAward);
                }
                //RadWindowManager2.RadAlert("Date of Award: " + dateOfAward, 330, 180, "Message", "");

                TextBox tbxTypeOfAward = editableItem["TypeOfAward"].Controls[0] as TextBox;
                string  typeOfAward    = tbxTypeOfAward.Text;

                TextBox tbxFamily = editableItem["family"].Controls[0] as TextBox;
                string  family    = tbxFamily.Text;
                //RadWindowManager2.RadAlert(family, 330, 180, "Message", "");

                TextBox tbxCustomer = editableItem["customer"].Controls[0] as TextBox;
                string  customer    = tbxCustomer.Text;

                TextBox tbxParentCustomer = editableItem["parent_customer"].Controls[0] as TextBox;
                string  parentCustomer    = tbxParentCustomer.Text;

                TextBox tbxProductLine = editableItem["product_line"].Controls[0] as TextBox;
                string  productLine    = tbxProductLine.Text;

                TextBox tbxEmpireMarketSegment = editableItem["empire_market_segment"].Controls[0] as TextBox;
                string  empireMarketSegment    = tbxEmpireMarketSegment.Text;

                TextBox tbxEmpireMarketSubsegment = editableItem["empire_market_subsegment"].Controls[0] as TextBox;
                string  empireMarketSubsegment    = tbxEmpireMarketSubsegment.Text;

                TextBox tbxEmpireApplication = editableItem["empire_application"].Controls[0] as TextBox;
                string  empireApplication    = tbxEmpireApplication.Text;

                RadDatePicker pkrSop      = (RadDatePicker)editableItem["empire_sop"].Controls[0];
                DateTime?     dtEmpireSop = null;
                if (pkrSop.SelectedDate.ToString() != "")
                {
                    dtEmpireSop = pkrSop.SelectedDate;
                }
                //RadWindowManager2.RadAlert(empireSop, 330, 180, "Message", "");

                RadDatePicker pkrMidModelYear = (RadDatePicker)editableItem["mid_model_year"].Controls[0];
                DateTime?     dtMidModelYear  = null;
                if (pkrMidModelYear.SelectedDate.ToString() != "")
                {
                    dtMidModelYear = pkrMidModelYear.SelectedDate;
                }

                RadDatePicker pkrEop      = (RadDatePicker)editableItem["empire_eop"].Controls[0];
                DateTime?     dtEmpireEop = null;
                if (pkrEop.SelectedDate.ToString() != "")
                {
                    dtEmpireEop = pkrEop.SelectedDate;
                }

                TextBox tbxEmpireEopNote = editableItem["empire_eop_note"].Controls[0] as TextBox;
                string  empireEopNote    = tbxEmpireEopNote.Text;

                bool includeInForecast = (editableItem["IncludeInForecast"].Controls[0] as CheckBox).Checked;

                UpdateBasePartAttributes(basePart, releaseId, salesperson, dtDateOfAward, typeOfAward, family, customer, parentCustomer, productLine,
                                         empireMarketSegment, empireMarketSubsegment, empireApplication, dtEmpireSop, dtMidModelYear, dtEmpireEop, empireEopNote, includeInForecast);
            }
        }
        catch (Exception ex)
        {
            RadWindowManager2.RadAlert("Error: " + ex.Message, 330, 180, "Error at UpdateCommand", "");
        }
    }