Ejemplo n.º 1
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     string name = this.txtName .Text ;
     string time = this.txttime.Text;
     string [] atime=time.Trim().Split (':');
     if ("" == atime[0]){ this.statuslblmsg.Text = "时间格式不正确!";return ;}
     if ("" == atime[1]) { this.statuslblmsg.Text = "时间格式不正确!"; return; }
     string week ="";
     if (this.chkMonday.Checked) week += "Monday,";
     if (this.chkTuesday.Checked) week += "Tuesday,";
     if (this.chkWednesday.Checked) week += "Wednesday,";
     if (this.chkThursday.Checked) week += "Thursday,";
     if (this.chkFriday.Checked) week += "Friday,";
     if (this.chkSaturday.Checked) week += "Saturday,";
     if (this.chkSunday.Checked) week += "Sunday,";
       string guid;
       if (null == txtName.Tag) guid = "";else  guid = this.txtName.Tag.ToString ();
       WriteData xml = new WriteData();
       xml.path = path;
       if (xml.EditClock(name, time, week, guid, "")) this.statuslblmsg.Text = "操作成功!"; else this.statuslblmsg.Text = "操作失败!";
 }
Ejemplo n.º 2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            string name = this.txtName.Text;
            string time = this.txttime.Text;

            string [] atime = time.Trim().Split(':');
            if ("" == atime[0])
            {
                this.statuslblmsg.Text = "时间格式不正确!"; return;
            }
            if ("" == atime[1])
            {
                this.statuslblmsg.Text = "时间格式不正确!"; return;
            }
            string week = "";

            if (this.chkMonday.Checked)
            {
                week += "Monday,";
            }
            if (this.chkTuesday.Checked)
            {
                week += "Tuesday,";
            }
            if (this.chkWednesday.Checked)
            {
                week += "Wednesday,";
            }
            if (this.chkThursday.Checked)
            {
                week += "Thursday,";
            }
            if (this.chkFriday.Checked)
            {
                week += "Friday,";
            }
            if (this.chkSaturday.Checked)
            {
                week += "Saturday,";
            }
            if (this.chkSunday.Checked)
            {
                week += "Sunday,";
            }
            string guid;

            if (null == txtName.Tag)
            {
                guid = "";
            }
            else
            {
                guid = this.txtName.Tag.ToString();
            }
            WriteData xml = new WriteData();

            xml.path = path;
            if (xml.EditClock(name, time, week, guid, ""))
            {
                this.statuslblmsg.Text = "操作成功!";
            }
            else
            {
                this.statuslblmsg.Text = "操作失败!";
            }
        }