Ejemplo n.º 1
0
    void Insert()
    {
        int conferenceCode;
        ConferenceManageBFL   cmBFL   = new ConferenceManageBFL();
        ConferenceManageModel cmModel = new ConferenceManageModel();

        AspWebControl.Calendar startDate = (AspWebControl.Calendar)(this.FormView1.FindControl("startDate"));
        AspWebControl.Calendar endDate   = (AspWebControl.Calendar)(this.FormView1.FindControl("endDate"));

        DropDownList ddlType = (DropDownList)(this.FormView1.Row.FindControl("DropDownListType"));

        ucDept = (RmsPM.Web.UserControls.InputUnit)(this.FormView1.Row.FindControl("Inputunit1"));
        TextBox     tbxTopic  = (TextBox)(this.FormView1.FindControl("TextBoxTopic"));
        TextBox     tbxRemark = (TextBox)(this.FormView1.FindControl("TextBoxRemark"));
        HiddenField hidPlace  = (HiddenField)(this.FormView1.FindControl("HidRoomCode"));

        cmModel.ChaterMember = user.UserCode;
        cmModel.Dept         = ucDept.Value;
        cmModel.Place        = hidPlace.Value;
        cmModel.Remark       = tbxRemark.Text;
        cmModel.State        = MeetStateType.UnAuthored.ToString();
        cmModel.Topic        = tbxTopic.Text;
        cmModel.Type         = ddlType.SelectedItem.Text;
        cmModel.StartTime    = cmBFL.GetUsefulDate(startDate.Value);
        cmModel.EndTime      = cmBFL.GetUsefulDate(endDate.Value);
        conferenceCode       = cmBFL.Insert(cmModel);
        this.ucadd           = (RmsPM.Web.UserControls.AttachMentAdd)(this.FormView1.Row.FindControl("Attachmentadd1"));
        ucadd.SaveAttachMent(conferenceCode.ToString());
        this.SaveDataIntoUserList("Attend", conferenceCode);
        this.SaveDataIntoUserList("OtherAttend", conferenceCode);
        Response.Redirect("XZ_ConferenceWeek.aspx");
    }
Ejemplo n.º 2
0
    protected void InsertButton_Click(object sender, EventArgs e)
    {
        int conferenceCode;
        ConferenceManageBFL   cmBFL   = new ConferenceManageBFL();
        ConferenceManageModel cmModel = new ConferenceManageModel();

        AspWebControl.Calendar startDate = (AspWebControl.Calendar)(this.FormView1.FindControl("startDate"));
        AspWebControl.Calendar endDate   = (AspWebControl.Calendar)(this.FormView1.FindControl("endDate"));
        DropDownList           ddlType   = (DropDownList)(this.FormView1.Row.FindControl("DropDownListType"));

        ucDept = (RmsPM.Web.UserControls.InputUnit)(this.FormView1.Row.FindControl("Inputunit1"));
        //DropDownList ddlDept = (DropDownList)(this.FormView1.Row.FindControl("DropDownListDept"));
        TextBox tbxTopic   = (TextBox)(this.FormView1.FindControl("TextBoxTopic"));
        TextBox tbxCharter = (TextBox)(this.FormView1.FindControl("TextBoxChaterMember"));
        TextBox tbxRemark  = (TextBox)(this.FormView1.FindControl("TextBoxRemark"));
        TextBox tbxPlace   = (TextBox)(this.FormView1.FindControl("TextBoxPlace"));

        cmModel.ChaterMember = tbxCharter.Text;
        cmModel.Dept         = ucDept.Text;
        cmModel.EndTime      = DateTime.Parse(endDate.Value);
        cmModel.Place        = tbxPlace.Text;
        cmModel.Remark       = tbxRemark.Text;
        cmModel.StartTime    = DateTime.Parse(startDate.Value);
        cmModel.State        = "未通过";
        cmModel.Topic        = tbxTopic.Text;
        cmModel.Type         = ddlType.SelectedItem.Text;
        conferenceCode       = cmBFL.Insert(cmModel);
        this.ucadd           = (RmsPM.Web.UserControls.AttachMentAdd)(this.FormView1.Row.FindControl("Attachmentadd1"));
        ucadd.SaveAttachMent(conferenceCode.ToString());
        this.SaveDataIntoUserList("Attend", conferenceCode);
        this.SaveDataIntoUserList("OtherAttend", conferenceCode);
        Response.Redirect("ConferenceWeek.aspx");
    }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(Request.QueryString["Type"]))
     {
         string type;
         type = Request.QueryString["Type"];
         if (!IsPostBack)
         {
             if (type.Equals("Add"))
             {
                 this.FormView1.ChangeMode(FormViewMode.Insert);
                 //DropDownList ddlType = (DropDownList)(this.FormView1.FindControl("DropDownListType"));
                 //ddlType.DataSource
                 //    = RmsPM.DAL.EntityDAO.SystemManageDAO.GetDictionaryItemByName("会议类型");
                 //ddlType.DataBind();
                 EntityData ed = RmsPM.DAL.EntityDAO.SystemManageDAO.GetDictionaryItemByName("会议类型");
                 //ed.Tables[0].WriteXml("D:\\Temp\\1.xml");
                 Label lblname = (Label)(this.FormView1.FindControl("LabelChaterMember"));
                 lblname.Text = user.UserName;
                 AspWebControl.Calendar startDate = (AspWebControl.Calendar)(this.FormView1.FindControl("startDate"));
                 AspWebControl.Calendar endDate   = (AspWebControl.Calendar)(this.FormView1.FindControl("endDate"));
                 startDate.Value = System.DateTime.Now.ToString();
                 endDate.Value   = System.DateTime.Now.ToString();
             }
         }
         if (type.Equals("Read"))
         {
             if (!String.IsNullOrEmpty(Request.QueryString["Code"]))
             {
                 int   conferenceCode       = Int32.Parse(Request.QueryString["Code"]);
                 Label lblAttendPerson      = (Label)(this.FormView1.Row.FindControl("LabelAttendPerson"));
                 Label lblOtherAttendPerson = (Label)(this.FormView1.Row.FindControl("LabelOtherAttendPerson"));
                 lblAttendPerson.Text      = this.GetAttendPersonList(conferenceCode, "Attend");
                 lblOtherAttendPerson.Text = this.GetAttendPersonList(conferenceCode, "OtherAttend");
                 Label       lblDept = (Label)(this.FormView1.FindControl("LabelDept"));
                 HiddenField hidDept = (HiddenField)(this.FormView1.FindControl("hidDept"));
                 lblDept.Text = RmsPM.BLL.SystemRule.GetUnitName(hidDept.Value);
             }
         }
     }
     else
     {
         if (!String.IsNullOrEmpty(Request.QueryString["Code"]))
         {
             int   conferenceCode       = Int32.Parse(Request.QueryString["Code"]);
             Label lblAttendPerson      = (Label)(this.FormView1.Row.FindControl("LabelAttendPerson"));
             Label lblOtherAttendPerson = (Label)(this.FormView1.Row.FindControl("LabelOtherAttendPerson"));
             lblAttendPerson.Text      = this.GetAttendPersonList(conferenceCode, "Attend");
             lblOtherAttendPerson.Text = this.GetAttendPersonList(conferenceCode, "OtherAttend");
         }
     }
 }
Ejemplo n.º 4
0
    private GK_OA_WorkLogModel _GetModelValue()
    {
        GK_OA_WorkLogModel wlModel = new GK_OA_WorkLogModel();

        FreeTextBoxControls.FreeTextBox tbxContext
            = (FreeTextBoxControls.FreeTextBox)(this.FormView1.Row.FindControl("ContextTextBox"));
        AspWebControl.Calendar dayWrited
            = (AspWebControl.Calendar)(this.FormView1.Row.FindControl("DayWrited"));
        DropDownList ddlWeather = (DropDownList)(this.FormView1.Row.FindControl("WeatherDropDownList"));
        DropDownList ddlMood    = (DropDownList)(this.FormView1.Row.FindControl("MoodDropDownList"));

        wlModel.UserId = user.UserID;
        DateTime time;

        if (DateTime.TryParse(dayWrited.Value, out time))
        {
            if (time.Year < 1800)
            {
                wlModel.DayWrited = DateTime.Now;
            }
            else
            {
                wlModel.DayWrited = time;
            }
        }
        else
        {
            wlModel.DayWrited = DateTime.Now;
        }
        if (!ddlMood.SelectedIndex.Equals(0))
        {
            wlModel.Mood = ddlMood.SelectedItem.Text.Trim();
        }
        else
        {
            wlModel.Mood = "";
        }
        if (!ddlWeather.SelectedIndex.Equals(0))
        {
            wlModel.Weather = ddlWeather.SelectedItem.Text.Trim();
        }
        else
        {
            wlModel.Weather = "";
        }
        wlModel.Context = tbxContext.Text.Trim();
        return(wlModel);
    }
Ejemplo n.º 5
0
    string ClushMessage()
    {
        string roomCode, begin, end, message;

        AspWebControl.Calendar startDate = (AspWebControl.Calendar)(this.FormView1.FindControl("startDate"));
        AspWebControl.Calendar endDate   = (AspWebControl.Calendar)(this.FormView1.FindControl("endDate"));
        HiddenField            hidPlace  = (HiddenField)(this.FormView1.FindControl("HidRoomCode"));

        roomCode = hidPlace.Value;
        begin    = startDate.Value;
        end      = endDate.Value;
        ConferenceUserListBFLFacade bfl = new ConferenceUserListBFLFacade();

        message = bfl.GetMeetClashMessage(null, roomCode, begin, end);
        return(message);
    }
Ejemplo n.º 6
0
    private GK_OA_CardsFolderModel _SetCardFolderModel()
    {
        GK_OA_CardsFolderModel cfModel    = new GK_OA_CardsFolderModel();
        TextBox         tbxName           = (TextBox)(this.CardFormView.Row.FindControl("UserNameTextBox"));
        DropDownList    ddlSex            = (DropDownList)(this.CardFormView.Row.FindControl("SexDropDownList"));
        TextBox         tbxAge            = (TextBox)(this.CardFormView.Row.FindControl("AgeTextBox"));
        TextBox         tbxCompanyName    = (TextBox)(this.CardFormView.Row.FindControl("CompanyNameTextBox"));
        TextBox         tbxCompanyAddress = (TextBox)(this.CardFormView.Row.FindControl("CompanyAddressTextBox"));
        TextBox         tbxHeaderShip     = (TextBox)(this.CardFormView.Row.FindControl("HeadshipTextBox"));
        TextBox         tbxDept           = (TextBox)(this.CardFormView.Row.FindControl("DeptTextBox"));
        TextBox         tbxPostalcode     = (TextBox)(this.CardFormView.Row.FindControl("PostalcodeTextBox"));
        TextBox         tbxPhone          = (TextBox)(this.CardFormView.Row.FindControl("PhoneTextBox"));
        TextBox         tbxFax            = (TextBox)(this.CardFormView.Row.FindControl("FaxTextBox"));
        TextBox         tbxMobile         = (TextBox)(this.CardFormView.Row.FindControl("MobileTextBox"));
        TextBox         tbxHomePhone      = (TextBox)(this.CardFormView.Row.FindControl("HomePhoneTextBox"));
        TextBox         tbxEmail          = (TextBox)(this.CardFormView.Row.FindControl("EmailTextBox"));
        TextBox         tbxNetAddress     = (TextBox)(this.CardFormView.Row.FindControl("NetAddressTextBox"));
        TextBox         tbxHobby          = (TextBox)(this.CardFormView.Row.FindControl("HobbyTextBox"));
        TextBox         tbxHomeAddress    = (TextBox)(this.CardFormView.Row.FindControl("HomeAddressTextBox"));
        TextBox         tbxNativePlace    = (TextBox)(this.CardFormView.Row.FindControl("NativePlaceTextBox"));
        DropDownList    ddlWedLock        = (DropDownList)(this.CardFormView.Row.FindControl("WedLockDropDownList"));
        DropDownList    ddlCardType       = (DropDownList)(this.CardFormView.Row.FindControl("CardTypeDropDownList"));
        TextBox         tbxRemark         = (TextBox)(this.CardFormView.Row.FindControl("RemarkTextBox"));
        RadioButtonList rblPublicStatus   = (RadioButtonList)(this.CardFormView.Row.FindControl("PublicSatuesRadioButtonList"));

        AspWebControl.Calendar birthday    = (AspWebControl.Calendar)(this.CardFormView.Row.FindControl("Birthday"));
        AspWebControl.Calendar contactTime = (AspWebControl.Calendar)(this.CardFormView.Row.FindControl("ContactTime"));
        cfModel.UserId   = this.user.UserID;
        cfModel.UserName = tbxName.Text.Trim();
        int age;

        if (Int32.TryParse(tbxAge.Text.Trim(), out age))
        {
            cfModel.Age = age;
        }
        cfModel.CompanyName    = tbxCompanyName.Text.Trim();
        cfModel.CompanyAddress = tbxCompanyAddress.Text.Trim();
        cfModel.Headship       = tbxHeaderShip.Text.Trim();
        cfModel.Dept           = tbxDept.Text.Trim();
        cfModel.Postalcode     = tbxPostalcode.Text.Trim();
        cfModel.Phone          = tbxPhone.Text.Trim();
        cfModel.Fax            = tbxFax.Text.Trim();
        cfModel.Mobile         = tbxMobile.Text.Trim();
        cfModel.HomePhone      = tbxHomePhone.Text.Trim();
        cfModel.Email          = tbxEmail.Text.Trim();
        cfModel.NetAddress     = tbxNetAddress.Text.Trim();
        cfModel.Hobby          = tbxHobby.Text.Trim();
        cfModel.HomeAddress    = tbxHomeAddress.Text.Trim();
        cfModel.NativePlace    = tbxNativePlace.Text.Trim();
        cfModel.Remark         = tbxRemark.Text.Trim();
        cfModel.PublicStatus   = rblPublicStatus.SelectedItem.Text;
        if (!ddlSex.SelectedIndex.Equals(0))
        {
            cfModel.Sex = ddlSex.SelectedItem.Text.Trim();
        }
        else
        {
            cfModel.Sex = "";
        }
        if (!ddlCardType.SelectedIndex.Equals(0))
        {
            cfModel.CardType = ddlCardType.SelectedItem.Text.Trim();
        }
        else
        {
            cfModel.CardType = "";
        }
        if (!ddlWedLock.SelectedIndex.Equals(0))
        {
            cfModel.Wedlock = ddlWedLock.SelectedItem.Text.Trim();
        }
        else
        {
            cfModel.Wedlock = "";
        }
        DateTime time;

        if (DateTime.TryParse(birthday.Value, out time))
        {
            if (time.Year < 1800)
            {
                cfModel.Birthday = DateTime.Now;
            }
            else
            {
                cfModel.Birthday = time;
            }
        }
        else
        {
            cfModel.Birthday = DateTime.Now;
        }
        if (DateTime.TryParse(contactTime.Value, out time))
        {
            if (time.Year < 1800)
            {
                cfModel.ContactTime = DateTime.Now;
            }
            else
            {
                cfModel.ContactTime = time;
            }
        }
        else
        {
            cfModel.ContactTime = DateTime.Now;
        }
        return(cfModel);
    }
Ejemplo n.º 7
0
        private string  SaveToSession()
        {
            string alertMsg = "";

            try
            {
                string ud_sContractCode = this.txtContractCode.Value;
                string ud_sProjectCode  = Request["ProjectCode"] + "";

                string ud_sContractCostCode = this.ddlCost.SelectedValue;

                EntityData entity = this.ReadEntitySession();

                foreach (DataRow dr in entity.Tables["ContractCost"].Select(string.Format("ContractCostCode='{0}'", ud_sContractCostCode)))
                {
                    if (this.ccStartDay.Value == "")
                    {
                        dr["PlanStartDate"] = DBNull.Value;
                    }
                    else
                    {
                        dr["PlanStartDate"] = this.ccStartDay.Value;
                    }

                    if (this.ccEndDay.Value == "")
                    {
                        dr["PlanEndDate"] = DBNull.Value;
                    }
                    else
                    {
                        dr["PlanEndDate"] = this.ccEndDay.Value;
                    }
                }


                foreach (DataGridItem ud_Item in this.dgCostList.Items)
                {
                    AspWebControl.Calendar ud_dtPlanningPayDate   = (AspWebControl.Calendar)ud_Item.FindControl("dtPlanningPayDate");
                    WebNumericEdit         ud_txtMoney            = (WebNumericEdit)ud_Item.FindControl("txtMoney");
                    HtmlInputText          ud_txtPayConditionText = (HtmlInputText)ud_Item.FindControl("txtPayConditionText");

                    string ud_sContractCostPlanCode = ud_Item.Cells[1].Text;

                    bool ud_bModify = false;

                    foreach (DataRow dr in entity.Tables["ContractCostPlan"].Select(String.Format("ContractCostPlanCode='{0}'", ud_sContractCostPlanCode)))
                    {
                        if (ud_dtPlanningPayDate.Value == "")
                        {
                            dr["PlanningPayDate"] = DBNull.Value;
                        }
                        else
                        {
                            dr["PlanningPayDate"] = ud_dtPlanningPayDate.Value;
                        }

                        dr["Money"]            = ud_txtMoney.ValueDecimal;
                        dr["PayConditionText"] = ud_txtPayConditionText.Value;

                        ud_bModify = true;
                    }

                    if (!ud_bModify)
                    {
                        DataRow ud_drNew = entity.Tables["ContractCostPlan"].NewRow();

                        ud_drNew["ContractCode"]         = ud_sContractCode;
                        ud_drNew["ContractCostCode"]     = ud_sContractCostCode;
                        ud_drNew["ContractCostPlanCode"] = ud_sContractCostPlanCode;

                        if (ud_dtPlanningPayDate.Value == "")
                        {
                            ud_drNew["PlanningPayDate"] = DBNull.Value;
                        }
                        else
                        {
                            ud_drNew["PlanningPayDate"] = ud_dtPlanningPayDate.Value;
                        }

                        ud_drNew["Money"]            = ud_txtMoney.ValueDecimal;
                        ud_drNew["PayConditionText"] = ud_txtPayConditionText.Value;

                        entity.Tables["ContractCostPlan"].Rows.Add(ud_drNew);
                    }
                }

                this.WriteEntitySession(entity);
                entity.Dispose();
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLog(this.ToString(), ex, "");
                Response.Write(Rms.Web.JavaScript.Alert(true, "保存出错:" + ex.Message));
            }
            return(alertMsg);
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 保存进度明细
        /// </summary>
        private void SaveDtl()
        {
            try
            {
                string PBSUnitCode = this.txtPBSUnitCode.Value;

                int iCount = this.dgList.Items.Count;
                for (int i = 0; i < iCount; i++)
                {
                    string                 code = this.dgList.DataKeys[i].ToString();
                    HtmlInputHidden        txtVisualProgress     = (HtmlInputHidden)this.dgList.Items[i].FindControl("txtVisualProgress");
                    HtmlInputHidden        txtVisualProgressName = (HtmlInputHidden)this.dgList.Items[i].FindControl("txtVisualProgressName");
                    HtmlInputHidden        txtProgressType       = (HtmlInputHidden)this.dgList.Items[i].FindControl("txtProgressType");
                    HtmlInputHidden        txtIsPoint            = (HtmlInputHidden)this.dgList.Items[i].FindControl("txtIsPoint");
                    AspWebControl.Calendar txtStartDate          = (AspWebControl.Calendar) this.dgList.Items[i].FindControl("txtStartDate");
                    AspWebControl.Calendar txtEndDate            = (AspWebControl.Calendar) this.dgList.Items[i].FindControl("txtEndDate");

                    EntityData entity = DAL.EntityDAO.ConstructDAO.GetConstructProgressStepByCode(code);
                    DataRow    dr;
                    bool       isNew = !entity.HasRecord();

                    if (isNew)
                    {
                        dr = entity.CurrentTable.NewRow();
                        dr["ProgressStepCode"] = RmsPM.DAL.EntityDAO.SystemManageDAO.GetNewSysCode("ProgressStepCode");
                    }
                    else
                    {
                        dr = entity.CurrentRow;
                    }

                    dr["PBSUnitCode"]    = PBSUnitCode;
                    dr["ProjectCode"]    = this.txtProjectCode.Value;
                    dr["VisualProgress"] = txtVisualProgress.Value;
                    dr["StartDate"]      = BLL.ConvertRule.ToDate(txtStartDate.Value);

                    //只填开始日期时,结束日期自动填开始日期
                    if (txtIsPoint.Value == "1")
                    {
                        dr["EndDate"] = dr["StartDate"];
                    }
                    else
                    {
                        dr["EndDate"] = BLL.ConvertRule.ToDate(txtEndDate.Value);
                    }


                    if (isNew)
                    {
                        entity.CurrentTable.Rows.Add(dr);
                        DAL.EntityDAO.ConstructDAO.InsertConstructProgressStep(entity);
                    }
                    else
                    {
                        DAL.EntityDAO.ConstructDAO.UpdateConstructProgressStep(entity);
                    }

                    entity.Dispose();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 有效性检查
        /// </summary>
        /// <param name="Hint"></param>
        /// <returns></returns>
        private bool CheckValid(ref string Hint)
        {
            Hint = "";

            if (txtReportDate.Value == "")
            {
                Hint = "请输入报告日期 ! ";
                return(false);
            }

            if (sltVisualProgress.Value == "")
            {
                Hint = "请选择形象进度 ! ";
                return(false);
            }

            string val = this.txtCurrentLayer.Value;

            if (val != "")
            {
                if (!Rms.Check.StringCheck.IsInt(val))
                {
                    Hint = "目前施工层数必须为整数 ! ";
                    return(false);
                }
            }

            string tempHint = BLL.PBSRule.CheckPBSUnitFloorCount(this.txtPBSUnitCode.Value, txtCurrentLayer.Value, "目前施工层数");

            if (tempHint != "")
            {
                Hint = tempHint;
                return(false);
            }

            //检查形象进度开始、结束日期
            int iCount = this.dgList.Items.Count;

            for (int i = 0; i < iCount; i++)
            {
                string                 code = this.dgList.DataKeys[i].ToString();
                HtmlInputHidden        txtVisualProgress     = (HtmlInputHidden)this.dgList.Items[i].FindControl("txtVisualProgress");
                HtmlInputHidden        txtVisualProgressName = (HtmlInputHidden)this.dgList.Items[i].FindControl("txtVisualProgressName");
                HtmlInputHidden        txtProgressType       = (HtmlInputHidden)this.dgList.Items[i].FindControl("txtProgressType");
                HtmlInputHidden        txtIsPoint            = (HtmlInputHidden)this.dgList.Items[i].FindControl("txtIsPoint");
                AspWebControl.Calendar txtStartDate          = (AspWebControl.Calendar) this.dgList.Items[i].FindControl("txtStartDate");
                AspWebControl.Calendar txtEndDate            = (AspWebControl.Calendar) this.dgList.Items[i].FindControl("txtEndDate");

                string StartDate = txtStartDate.Value.Trim();
                string EndDate   = txtEndDate.Value.Trim();
                if ((StartDate != "") && (EndDate != ""))
                {
                    if (!BLL.ConvertRule.IsDateStartLessThanEnd(StartDate, EndDate))
                    {
                        Hint = string.Format("结束日期({1})不能小于开始日期({0})", StartDate, EndDate);
                        return(false);
                    }
                }
            }

            return(true);
        }